Welcome to Findnerd. Today we are going to dicuss the strict typing mode and weak typing mode which is introduced in PHP7. strict typing mode is not activated by default.
You need to activate it via declare like this
It should be first statement in your file. It will activate the strict typing mode in current file. It will only applied called functions in the file not defined functions.
In above example we have set the strict typing mode. We created a function named userdata with two arguments that are name , datatype is string and another is integer phone
we called the function twice. In second call we passed the phone number as string. It should be integer. It will return the error for correct type.
If you do not declare the strict type to 1, it will be work as strict typing mode. In weak typing it will convert the phone number into a interger. You can also
set the weak typing by this