php Errors not Seen on my test system
-
error_reporting( E_ALL | E_STRICT ); $array['def'] = 'def'; foreach ( $array['abc'] as $a ) { }
On my test system, that PHP works “properly” and gives no error messages.
A plugin user on different web hosting gets the following errors:
Notice: Undefined index: abc in /home/inbikaco/public_html/_subdomains/demo1/foreach.php on line 4
Warning: Invalid argument supplied for foreach() in /home/inbikaco/public_html/_subdomains/demo1/foreach.php on line 4I’ve now fixed my plugin, by adding an
if ( isset( $array['abc'] ))
in front of the foreach.My question is how to improve my Test environment so I catch errors like that? I routinely test with WP_DEBUG set to TRUE. And setting the PHP error reporting level clearly isn’t working either.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘php Errors not Seen on my test system’ is closed to new replies.