3v4l.org

run code in 300+ PHP versions simultaneously
<?php function crash() { set_error_handler(function () {}); $var = 1; trigger_error('error'); $var2 = $var; $var3 = $var; trigger_error('error'); } $items = new ArrayObject(); unset($items[0]); unset($items[0][0]); echo "Okay"; crash(); echo "Worked!\n";
Output for 8.1.0 - 8.1.27, 8.2.0 - 8.2.17, 8.3.0 - 8.3.4
Notice: Indirect modification of overloaded element of ArrayObject has no effect in /in/aGvH3 on line 16 OkayWorked!
Output for 8.0.0 - 8.0.30
Warning: Undefined array key 0 in /in/aGvH3 on line 15 Notice: Indirect modification of overloaded element of ArrayObject has no effect in /in/aGvH3 on line 16 OkayWorked!
Output for 5.4.8 - 5.4.12, 5.4.30 - 5.4.45, 5.5.14 - 5.5.35, 5.6.0 - 5.6.28, 7.0.0 - 7.0.20, 7.1.0 - 7.1.7, 7.2.0 - 7.2.33, 7.3.12 - 7.3.31, 7.4.0 - 7.4.25, 7.4.27 - 7.4.33
Notice: Undefined offset: 0 in /in/aGvH3 on line 15 Notice: Indirect modification of overloaded element of ArrayObject has no effect in /in/aGvH3 on line 16 OkayWorked!
Output for 7.3.32 - 7.3.33, 7.4.26
OkayWorked!
Output for 5.4.13 - 5.4.29, 5.5.0 - 5.5.13
Notice: Undefined offset: 0 in /in/aGvH3 on line 15 Okay
Process exited with code 139.
Output for 5.3.0 - 5.3.17, 5.4.0 - 5.4.7
Notice: Undefined offset: 0 in /in/aGvH3 on line 15 Notice: Undefined offset: 0 in /in/aGvH3 on line 16 Notice: Indirect modification of overloaded element of ArrayObject has no effect in /in/aGvH3 on line 16 OkayWorked!
Output for 5.3.18 - 5.3.22, 5.3.29
Notice: Undefined offset: 0 in /in/aGvH3 on line 15 Notice: Indirect modification of overloaded element of ArrayObject has no effect in /in/aGvH3 on line 16 OkayWorked!
Output for 5.3.23 - 5.3.28
Notice: Undefined offset: 0 in /in/aGvH3 on line 15 OkayWorked!
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17
Parse error: syntax error, unexpected T_FUNCTION, expecting ')' in /in/aGvH3 on line 5
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.3.11, 4.4.0 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected T_FUNCTION, expecting ')' in /in/aGvH3 on line 5
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `')'' in /in/aGvH3 on line 5
Process exited with code 255.

preferences:
246.57 ms | 401 KiB | 338 Q