3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function test_1($arg_1, $arg_2) { return $arg_1 + $arg_2; } $a = 1; $b = 2; $result = test_1($a, $b); echo $result; $test_array = [1,3,5,7]; foreach($test_array as &$var){ $result_1 = $var; $result_2 = &$result_1; $result_2 = $var + 1; echo 'result_1 = '.$result_1.' var = '.$var."\n\n"; }
based on 5IISD
Output for 5.4.10 - 7.2.0
3result_1 = 2 var = 1 result_1 = 4 var = 3 result_1 = 6 var = 5 result_1 = 8 var = 7
Output for 5.3.20 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/pDv8K on line 10
Process exited with code 255.