3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = new stdClass; $b->b->c->d = 42; var_dump($a);
Output for 8.0.0
Fatal error: Uncaught Error: Attempt to modify property "b" on null in /in/3CbdT:3 Stack trace: #0 {main} thrown in /in/3CbdT on line 3
Process exited with code 255.
Output for 7.4.0 - 7.4.12
Warning: Creating default object from empty value in /in/3CbdT on line 3 Warning: Creating default object from empty value in /in/3CbdT on line 3 Warning: Creating default object from empty value in /in/3CbdT on line 3 object(stdClass)#1 (0) { }
Output for 7.2.0 - 7.2.34, 7.3.0 - 7.3.24
Warning: Creating default object from empty value in /in/3CbdT on line 3 object(stdClass)#1 (0) { }