3v4l.org

run code in 300+ PHP versions simultaneously
<?php class test { public function __construct() { $this->test = 'meow'; } } function error_handler() { $test = new test(); return true; } set_error_handler("error_handler"); // test one class a {} $a = new a; $a->undefined .= 'test'; echo isset($a->undefined) ? 'true' : 'false'; echo "\n"; // test two $b .= 'test'; echo isset($b) ? 'true' : 'false'; echo "\n";
Output for 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
Deprecated: Creation of dynamic property test::$test is deprecated in /in/KGXhF on line 5 Deprecated: Creation of dynamic property test::$test is deprecated in /in/KGXhF on line 5 true Deprecated: Creation of dynamic property test::$test is deprecated in /in/KGXhF on line 5 true
Output for 5.4.0 - 5.4.45, 5.5.19 - 5.5.38, 5.6.3 - 5.6.28, 7.0.0 - 7.0.20, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28
true true
Output for 5.5.0 - 5.5.18, 5.6.0 - 5.6.2
false true

preferences:
205.15 ms | 402 KiB | 303 Q