3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php /*function add($a, $b){ return $a + $b; } echo add(2,3); function subtract ($a, $b){ return $a - $b; } echo subtract(5,4); function concatenate($a, $b){ return $a . $b; } echo concatenate('Hello', 'Wie');*/ //$arr = ['test', 'test2']; //print_r($arr[0]); function addToArray($arg1, $arg2){ $arr2 = []; $arr2[] = $arg1; $arr2[] = $arg2; print_r($arr2); } addToArray('Hallo','Yoooo'); var_dump($existiertnicht); $existiertnicht[] = 'Test'; print_r($existiertnicht); echo $gibtsnicht + 9;
based on lvrQM
Output for 5.4.0 - 7.2.0
Array ( [0] => Hallo [1] => Yoooo ) Notice: Undefined variable: existiertnicht in /in/OM5jp on line 35 NULL Array ( [0] => Test ) Notice: Undefined variable: gibtsnicht in /in/OM5jp on line 38 9
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/OM5jp on line 26
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected '[' in /in/OM5jp on line 26
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/OM5jp on line 26
Process exited with code 255.