3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $original = [ CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1 ]; $update = [ CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_2_0 ]; var_dump($original, $update, $original += $update, array_replace($original, $update));
Output for 7.2.0
Warning: Use of undefined constant CURLOPT_HTTP_VERSION - assumed 'CURLOPT_HTTP_VERSION' (this will throw an Error in a future version of PHP) in /in/ZUIIt on line 4 Warning: Use of undefined constant CURL_HTTP_VERSION_1_1 - assumed 'CURL_HTTP_VERSION_1_1' (this will throw an Error in a future version of PHP) in /in/ZUIIt on line 4 Warning: Use of undefined constant CURLOPT_HTTP_VERSION - assumed 'CURLOPT_HTTP_VERSION' (this will throw an Error in a future version of PHP) in /in/ZUIIt on line 8 Warning: Use of undefined constant CURL_HTTP_VERSION_2_0 - assumed 'CURL_HTTP_VERSION_2_0' (this will throw an Error in a future version of PHP) in /in/ZUIIt on line 8 array(1) { ["CURLOPT_HTTP_VERSION"]=> string(21) "CURL_HTTP_VERSION_1_1" } array(1) { ["CURLOPT_HTTP_VERSION"]=> string(21) "CURL_HTTP_VERSION_2_0" } array(1) { ["CURLOPT_HTTP_VERSION"]=> string(21) "CURL_HTTP_VERSION_1_1" } array(1) { ["CURLOPT_HTTP_VERSION"]=> string(21) "CURL_HTTP_VERSION_2_0" }
Output for 7.0.0 - 7.1.10
Notice: Use of undefined constant CURLOPT_HTTP_VERSION - assumed 'CURLOPT_HTTP_VERSION' in /in/ZUIIt on line 4 Notice: Use of undefined constant CURL_HTTP_VERSION_1_1 - assumed 'CURL_HTTP_VERSION_1_1' in /in/ZUIIt on line 4 Notice: Use of undefined constant CURLOPT_HTTP_VERSION - assumed 'CURLOPT_HTTP_VERSION' in /in/ZUIIt on line 8 Notice: Use of undefined constant CURL_HTTP_VERSION_2_0 - assumed 'CURL_HTTP_VERSION_2_0' in /in/ZUIIt on line 8 array(1) { ["CURLOPT_HTTP_VERSION"]=> string(21) "CURL_HTTP_VERSION_1_1" } array(1) { ["CURLOPT_HTTP_VERSION"]=> string(21) "CURL_HTTP_VERSION_2_0" } array(1) { ["CURLOPT_HTTP_VERSION"]=> string(21) "CURL_HTTP_VERSION_1_1" } array(1) { ["CURLOPT_HTTP_VERSION"]=> string(21) "CURL_HTTP_VERSION_2_0" }
Output for hhvm-3.15.4 - 3.17.3
array(1) { [84]=> int(2) } array(1) { [84]=> int(3) } array(1) { [84]=> int(2) } array(1) { [84]=> int(3) }
Output for hhvm-3.10.1 - 3.13.2
Notice: Use of undefined constant CURL_HTTP_VERSION_2_0 - assumed 'CURL_HTTP_VERSION_2_0' in /in/ZUIIt on line 8 array(1) { [84]=> int(2) } array(1) { [84]=> string(21) "CURL_HTTP_VERSION_2_0" } array(1) { [84]=> int(2) } array(1) { [84]=> string(21) "CURL_HTTP_VERSION_2_0" }
Output for 5.4.0 - 5.6.30
Notice: Use of undefined constant CURLOPT_HTTP_VERSION - assumed 'CURLOPT_HTTP_VERSION' in /in/ZUIIt on line 4 Notice: Use of undefined constant CURL_HTTP_VERSION_1_1 - assumed 'CURL_HTTP_VERSION_1_1' in /in/ZUIIt on line 5 Notice: Use of undefined constant CURLOPT_HTTP_VERSION - assumed 'CURLOPT_HTTP_VERSION' in /in/ZUIIt on line 8 Notice: Use of undefined constant CURL_HTTP_VERSION_2_0 - assumed 'CURL_HTTP_VERSION_2_0' in /in/ZUIIt on line 9 array(1) { ["CURLOPT_HTTP_VERSION"]=> string(21) "CURL_HTTP_VERSION_1_1" } array(1) { ["CURLOPT_HTTP_VERSION"]=> string(21) "CURL_HTTP_VERSION_2_0" } array(1) { ["CURLOPT_HTTP_VERSION"]=> string(21) "CURL_HTTP_VERSION_1_1" } array(1) { ["CURLOPT_HTTP_VERSION"]=> string(21) "CURL_HTTP_VERSION_2_0" }
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/ZUIIt on line 3
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/ZUIIt on line 3
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/ZUIIt on line 3
Process exited with code 255.