3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test{function __construct(){$a=array('I','n','i','t','i','a','t','i','n','g',' ','o','n','e',' ','l','i','n','e',' ','c','l','a','s','s','.','.','.','<','b','r',' ','/','>');foreach($a as $b){echo$b;}}function __destruct(){$a=array('<','b','r',' ','/','>','D','e','s','t','r','o','y','i','n','g',' ','t','h','e',' ','c','l','a','s','s','.','.','.');foreach($a as $b){echo$b;}}function testing(){$a=array('T','h','i','s',' ','i','s',' ','a','n',' ','f','u','n','c','t','i','o','n',' ','i','n',' ','t','h','e',' ','o','n','e',' ','l','i','n','e',' ','c','l','a','s','s','.','5','+','5','=','0');$c=0;$d=0;foreach($a as $b){if(is_numeric($b)){if($c==0){$c=$b;echo$b;}elseif($d==0){$d=$b;echo$b;}else{echo($c+$d);}}else{echo$b;}}}}$test=new Test();$test->testing();unset($test);

preferences:
47.57 ms | 402 KiB | 5 Q