3v4l.org

run code in 300+ PHP versions simultaneously
<?php class test { public static $x; public function __toString() { self::$x = $this; return __FILE__; } } $a = new test; require_once $a; debug_zval_dump(test::$x);
Output for 7.0.0 - 7.0.33, 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, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
object(test)#1 (0) refcount(3){ }
Output for 5.3.11 - 5.3.29, 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.40
string(9) "/in/kCShJ" refcount(2)
Output for 5.3.10
&UNKNOWN:0
Output for 5.3.0 - 5.3.7, 5.3.9
NULL refcount(0)
Output for 5.3.8
NULL refcount(1)
Output for 5.2.17
NULL refcount(38248368)
Output for 5.2.16
NULL refcount(29630384)
Output for 5.2.15
NULL refcount(24567728)
Output for 5.2.14
NULL refcount(29896624)
Output for 5.2.13
NULL refcount(25014192)
Output for 5.2.12
NULL refcount(20938672)
Output for 5.2.11
NULL refcount(30453280)
Output for 5.2.10
NULL refcount(40729600)
Output for 5.2.9
NULL refcount(27876256)
Output for 5.2.8
NULL refcount(17238704)
Output for 5.2.7
NULL refcount(23390896)
Output for 5.2.6
NULL refcount(29799136)
Output for 5.2.5
NULL refcount(17359584)
Output for 5.2.4
NULL refcount(39748304)
Output for 5.2.3
NULL refcount(40418016)
Output for 5.2.2
NULL refcount(46630728)
Output for 5.2.1
string(9) "�e&J" refcount(3)
Output for 5.2.0
NULL refcount(39291728)
Output for 5.1.0 - 5.1.6
Notice: Object of class test to string conversion in /in/kCShJ on line 11 Warning: require_once(Object): failed to open stream: No such file or directory in /in/kCShJ on line 11 Fatal error: require_once(): Failed opening required 'Object' (include_path='.:') in /in/kCShJ on line 11
Process exited with code 255.
Output for 5.0.0 - 5.0.5
Notice: Object of class test to string conversion in /in/kCShJ on line 11 Warning: main(Object): failed to open stream: No such file or directory in /in/kCShJ on line 11 Fatal error: main(): Failed opening required 'Object' (include_path='.:') in /in/kCShJ on line 11
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/kCShJ on line 4
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
Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/kCShJ on line 4
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in /in/kCShJ on line 4
Process exited with code 255.

preferences:
347.28 ms | 401 KiB | 458 Q