3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $a = ['a', 'b', 'c', 'idx' => 'kek']; $b = [1, 2, 3]; var_dump(array_merge($a, $b)); var_dump(json_decode('{"a": 34}', true)); var_dump($a['idx'] ?? null); var_dump(openssl_get_cert_locations()); ?>
based on 850Di
Output for 7.0.30 - 7.3.0beta1
array(7) { [0]=> string(1) "a" [1]=> string(1) "b" [2]=> string(1) "c" ["idx"]=> string(3) "kek" [3]=> int(1) [4]=> int(2) [5]=> int(3) } array(1) { ["a"]=> int(34) } string(3) "kek" Fatal error: Uncaught Error: Call to undefined function openssl_get_cert_locations() in /in/pe26e:7 Stack trace: #0 {main} thrown in /in/pe26e on line 7
Process exited with code 255.
Output for hhvm-3.22.0
array(7) { [0]=> string(1) "a" [1]=> string(1) "b" [2]=> string(1) "c" ["idx"]=> string(3) "kek" [3]=> int(1) [4]=> int(2) [5]=> int(3) } array(1) { ["a"]=> int(34) } string(3) "kek" Fatal error: Uncaught Error: Call to undefined function openssl_get_cert_locations() in /in/pe26e:-1 Stack trace: #0 {main}
Process exited with code 255.
Output for hhvm-3.18.5 - 3.21.3
array(7) { [0]=> string(1) "a" [1]=> string(1) "b" [2]=> string(1) "c" ["idx"]=> string(3) "kek" [3]=> int(1) [4]=> int(2) [5]=> int(3) } array(1) { ["a"]=> int(34) } string(3) "kek" Fatal error: Uncaught Error: Call to undefined function openssl_get_cert_locations() in /in/pe26e:7 Stack trace: #0 {main}
Process exited with code 255.
Output for 5.6.30
Parse error: syntax error, unexpected '?' in /in/pe26e on line 6
Process exited with code 255.