3v4l.org

run code in 300+ PHP versions simultaneously
<?php ini_set('display_errors', '1'); error_reporting(-1); $i++; // correctly shows notice echo "\n\n"; $x = &$foo->bar['bazz']['yadda']; // no notices $x[] = 123; var_export($foo); // but it exists! all of it! ?>
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.27, 8.2.0 - 8.2.18, 8.3.0 - 8.3.4, 8.3.6
Warning: Undefined variable $i in /in/k3P8u on line 5 Fatal error: Uncaught Error: Attempt to modify property "bar" on null in /in/k3P8u:8 Stack trace: #0 {main} thrown in /in/k3P8u on line 8
Process exited with code 255.
Output for 8.3.5
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 Warning: Undefined variable $i in /in/k3P8u on line 5 Fatal error: Uncaught Error: Attempt to modify property "bar" on null in /in/k3P8u:8 Stack trace: #0 {main} thrown in /in/k3P8u on line 8
Process exited with code 255.
Output for 7.4.0 - 7.4.33
Notice: Undefined variable: i in /in/k3P8u on line 5 Warning: Creating default object from empty value in /in/k3P8u on line 8 (object) array( 'bar' => array ( 'bazz' => array ( 'yadda' => array ( 0 => 123, ), ), ), )
Output for 7.3.0 - 7.3.33
Notice: Undefined variable: i in /in/k3P8u on line 5 (object) array( 'bar' => array ( 'bazz' => array ( 'yadda' => array ( 0 => 123, ), ), ), )
Output for 5.1.0 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.28, 5.4.0 - 5.4.27, 5.4.38 - 5.4.45, 5.5.24 - 5.5.35, 5.6.7 - 5.6.28, 7.0.0 - 7.0.20, 7.1.0 - 7.1.25, 7.2.0 - 7.2.33
Notice: Undefined variable: i in /in/k3P8u on line 5 stdClass::__set_state(array( 'bar' => array ( 'bazz' => array ( 'yadda' => array ( 0 => 123, ), ), ), ))
Output for 5.3.29, 5.4.28 - 5.4.37
Warning: ini_set() has been disabled for security reasons in /in/k3P8u on line 2 Notice: Undefined variable: i in /in/k3P8u on line 5 stdClass::__set_state(array( 'bar' => array ( 'bazz' => array ( 'yadda' => array ( 0 => 123, ), ), ), ))
Output for 5.0.4 - 5.0.5
Notice: Undefined variable: i in /in/k3P8u on line 5 class stdClass { public $bar = array ( 'bazz' => array ( 'yadda' => array ( 0 => 123, ), ), ); }
Output for 5.0.0 - 5.0.3
Notice: Undefined variable: i in /in/k3P8u on line 5 class stdClass { public $bar = array ( 'bazz' => array ( 'yadda' => array ( 0 => 123, ), ), ); }
Output for 4.3.0 - 4.3.11, 4.4.0 - 4.4.9
Notice: Undefined variable: i in /in/k3P8u on line 5 class stdClass { var $bar = array ( 'bazz' => array ( 'yadda' => array ( 0 => 123, ), ), ); }

preferences:
226.37 ms | 402 KiB | 329 Q