3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php var_dump(error_reporting()); // Turn off all error reporting error_reporting(0); var_dump(error_reporting()); // Report simple running errors error_reporting(E_ERROR | E_WARNING | E_PARSE); var_dump(error_reporting()); // Reporting E_NOTICE can be good too (to report uninitialized // variables or catch variable name misspellings ...) error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE); var_dump(error_reporting()); // Report all errors except E_NOTICE error_reporting(E_ALL & ~E_NOTICE); var_dump(error_reporting()); // Report all PHP errors (see changelog) error_reporting(E_ALL); var_dump(error_reporting()); // Report all PHP errors error_reporting(-1); var_dump(error_reporting());
based on CtT4L
Output for 5.4.0 - 5.6.28, 7.0.0 - 7.1.0
int(-1) int(0) int(7) int(15) int(32759) int(32767) int(-1)
Output for hhvm-3.10.0 - 3.12.0
int(8191) int(0) int(7) int(15) int(32759) int(32767) int(-1)
Output for 5.3.0 - 5.3.29
int(-1) int(0) int(7) int(15) int(30711) int(30719) int(-1)
Output for 5.2.0 - 5.2.17
int(-1) int(0) int(7) int(15) int(6135) int(6143) int(-1)
Output for 4.3.0 - 5.1.6
int(-1) int(0) int(7) int(15) int(2039) int(2047) int(-1)