Must be a string, string given
#1
I was helping a friend with some PHP. It was working fine on my computer but failing with no errors on his. I told him to add the debugging code listed below to show the errors:

PHP Code:
ini_set('display_errors'1);
ini_set('display_startup_errors'1);
error_reporting(E_ALL E_STRICT); 

Upon adding, his machine threw this error:

Catchable fatal error: Argument 1 passed to myFunction() must be an instance of string, string given, called in /file.php on line 88 and defined in /file.php on line 49

So basically, PHP was requiring a string... but throwing an error when a string was passed. Nice job PHP.

Advice: always sync your PHP versions across dev environments! This was due in part to specifying a type declaration in an older version of PHP than I was using.


I post about the latest site updates on the Dev Log. If you have suggestions, feel free to post them here.
@Eternal and I pay for this site out of our own savings. Please donate to help keep JV Revival free for all.
The Following 1 User Says Thank You to bls1999 For This Useful Post:
  • Ashley766
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)