Last active
January 10, 2018 21:44
-
-
Save macintoshplus/522cd55fb7c27511ce94207ce9ab767d to your computer and use it in GitHub Desktop.
Strange work for PHP 7+ for error_reporting reading
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/Users/jb/Sites/testErrorHandler/index.php:5:int 0 | |
/Users/jb/Sites/testErrorHandler/index.php:5:string '32767' (length=5) | |
/Users/jb/Sites/testErrorHandler/index.php:5:int 0 | |
/Users/jb/Sites/testErrorHandler/index.php:5:string 'deprecated' (length=10) | |
/Users/jb/Sites/testErrorHandler/index.php:5:int 0 | |
/Users/jb/Sites/testErrorHandler/index.php:5:string '32767' (length=5) | |
/Users/jb/Sites/testErrorHandler/index.php:5:int 0 | |
/Users/jb/Sites/testErrorHandler/index.php:5:string 'user warning' (length=12) | |
/Users/jb/Sites/testErrorHandler/index.php:12:string '7.0.23' (length=6) | |
This is due to the @ before the trigger_error function name. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
error_reporting(E_ALL); | |
set_error_handler(function ( int $errno , string $errstr , string $errfile , int $errline , array $errcontext) { | |
var_dump(error_reporting(), ini_get('error_reporting'), error_reporting() & $errno, $errstr); | |
}, E_ALL); | |
@trigger_error('deprecated', E_USER_DEPRECATED); | |
@trigger_error('user warning', E_USER_NOTICE); | |
var_dump(PHP_VERSION); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment