3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $array = array("name"=>"Sheldon","age"=>"42",BOTH); var_dump($array); list($a,$a) = $array;
Output for 7.2.0 - 7.2.11
Warning: Use of undefined constant BOTH - assumed 'BOTH' (this will throw an Error in a future version of PHP) in /in/VJTEM on line 2 array(3) { ["name"]=> string(7) "Sheldon" ["age"]=> string(2) "42" [0]=> string(4) "BOTH" } Notice: Undefined offset: 1 in /in/VJTEM on line 4
Output for 5.3.0 - 5.6.38, 7.0.0 - 7.1.23
Notice: Use of undefined constant BOTH - assumed 'BOTH' in /in/VJTEM on line 2 array(3) { ["name"]=> string(7) "Sheldon" ["age"]=> string(2) "42" [0]=> string(4) "BOTH" } Notice: Undefined offset: 1 in /in/VJTEM on line 4
Output for hhvm-3.22.0
Notice: Use of undefined constant BOTH - assumed 'BOTH' in /in/VJTEM on line -1 array(3) { ["name"]=> string(7) "Sheldon" ["age"]=> string(2) "42" [0]=> string(4) "BOTH" } Notice: Undefined index: 1 in /in/VJTEM on line -1
Output for hhvm-3.10.1 - 3.21.3
Notice: Use of undefined constant BOTH - assumed 'BOTH' in /in/VJTEM on line 2 array(3) { ["name"]=> string(7) "Sheldon" ["age"]=> string(2) "42" [0]=> string(4) "BOTH" } Notice: Undefined index: 1 in /in/VJTEM on line 4
Output for 4.3.0 - 5.2.17
Notice: Use of undefined constant BOTH - assumed 'BOTH' in /in/VJTEM on line 2 array(3) { ["name"]=> string(7) "Sheldon" ["age"]=> string(2) "42" [0]=> string(4) "BOTH" } Notice: Undefined offset: 1 in /in/VJTEM on line 4