3v4l.org

run code in 300+ PHP versions simultaneously
<?php ini_set('max_execution_time', 1); set_error_handler(null, E_ALL); class A { function __get($name) { return $name; } } global $a; $a = new A; function shutdown() { global $a; // Warning: Undefined property: A::$foo ... var_dump($a->foo); } register_shutdown_function('shutdown'); // Try to trigger "Fatal error: Maximum execution time of 1 second exceeded" // within the A::__get() method. for ($i = 0; $i < 100000000; $i++) { $a->foo; }
Output for 8.1.0 - 8.1.1, 8.1.4 - 8.1.5, 8.1.7 - 8.1.9, 8.1.11 - 8.1.15, 8.1.19 - 8.1.23, 8.1.27 - 8.1.29, 8.1.31 - 8.1.32, 8.2.0, 8.2.2 - 8.2.5, 8.2.7 - 8.2.8, 8.2.12 - 8.2.16, 8.2.18, 8.2.20 - 8.2.24, 8.2.26, 8.2.29, 8.3.0 - 8.3.4, 8.3.7 - 8.3.8, 8.3.11 - 8.3.14, 8.3.18 - 8.3.22, 8.3.25, 8.4.3 - 8.4.5, 8.4.7 - 8.4.8, 8.4.10 - 8.4.12, 8.4.14
Fatal error: Maximum execution time of 1 second exceeded in /in/DhXZH on line 9 Warning: Undefined property: A::$foo in /in/DhXZH on line 18 NULL
Process exited with code 255.
Output for 8.1.2 - 8.1.3, 8.1.6, 8.1.10, 8.1.16 - 8.1.18, 8.1.24 - 8.1.26, 8.1.30, 8.1.33, 8.2.1, 8.2.6, 8.2.9 - 8.2.11, 8.2.17, 8.2.19, 8.2.25, 8.2.27 - 8.2.28, 8.3.5 - 8.3.6, 8.3.9 - 8.3.10, 8.3.15 - 8.3.17, 8.3.23 - 8.3.24, 8.3.26, 8.4.1 - 8.4.2, 8.4.6, 8.4.9, 8.4.13
Fatal error: Maximum execution time of 1 second exceeded in /in/DhXZH on line 26 string(3) "foo"
Process exited with code 255.

preferences:
88.6 ms | 411 KiB | 5 Q