3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { private $x = 1; } $f = new Foo; var_export($f); $x = var_export($f, true); eval("$x;");
Output for 8.2.0 - 8.2.30, 8.3.0 - 8.3.30, 8.4.1 - 8.4.18, 8.5.0 - 8.5.3
\Foo::__set_state(array( 'x' => 1, )) Fatal error: Uncaught Error: Call to undefined method Foo::__set_state() in /in/X9BCL(14) : eval()'d code:1 Stack trace: #0 /in/X9BCL(14): eval() #1 {main} thrown in /in/X9BCL(14) : eval()'d code on line 1
Process exited with code 255.
Output for 7.1.0 - 7.1.25, 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.34
Foo::__set_state(array( 'x' => 1, )) Fatal error: Uncaught Error: Call to undefined method Foo::__set_state() in /in/X9BCL(14) : eval()'d code:1 Stack trace: #0 /in/X9BCL(14): eval() #1 {main} thrown in /in/X9BCL(14) : eval()'d code on line 1
Process exited with code 255.

preferences:
102.92 ms | 1504 KiB | 4 Q