lupiya Posted November 5, 2012 Share Posted November 5, 2012 On page 252 it says when the error reporting is turned off (set to zero), php does not display any errors. But when I tried to do the same, it actually displayed errors. I am using php version 5.5.25. Could something be wrong with my version or is there something I do not know? This is what I did: error_reporting(0); //Create errors: foreach ($var as $v) {} $result = 1/0; And I got this result: Testing Error Reporting Notice: Undefined variable: var in /Applications/MAMP/htdocs/php/report_errors.php on line 16 Warning: Invalid argument supplied for foreach() in /Applications/MAMP/htdocs/php/report_errors.php on line 16 Warning: Division by zero in /Applications/MAMP/htdocs/php/report_errors.php on line 17 Link to comment Share on other sites More sharing options...
Larry Posted November 6, 2012 Share Posted November 6, 2012 Well, one thing I can say is you're not using PHP 5.5.25. The current highest version is 5.4.8. But other than that, I would guess that particular override (using error_reporting()) is not allowed in your setup. 2 Link to comment Share on other sites More sharing options...
lupiya Posted November 9, 2012 Author Share Posted November 9, 2012 Thanks! Will check it out and adjust accordingly ... Sorry about the wrong version. I am actually using 5.4.8 . I looked at the wrong place. I checked on top of Mysql terminal where I log in and it said my server version was 5.5.25 Source distribution. This, I mistook for a php version. Link to comment Share on other sites More sharing options...
Recommended Posts