3v4l.org

run code in 300+ PHP versions simultaneously
<?php class s { const seven = 7; static $y = array(seven, 'seven', 7); function s($x) { static $y = array(seven, 'seven', 7); $y[] = $x; return $y; } } const seven = 7; function foo($x) { static $y = array(seven, 'seven', 7); $y[] = $x; return $y; } new s(2); var_export(foo(4)); var_export(foo(3));

preferences:
60.34 ms | 402 KiB | 5 Q