3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $arr = array(0=>1,1=>2, x=>y, p=>q); $check = true; unset($arr[0], $check); print_r($arr);
Output for 7.2.0 - 7.2.6
Warning: Use of undefined constant x - assumed 'x' (this will throw an Error in a future version of PHP) in /in/6fbtG on line 3 Warning: Use of undefined constant y - assumed 'y' (this will throw an Error in a future version of PHP) in /in/6fbtG on line 3 Warning: Use of undefined constant p - assumed 'p' (this will throw an Error in a future version of PHP) in /in/6fbtG on line 3 Warning: Use of undefined constant q - assumed 'q' (this will throw an Error in a future version of PHP) in /in/6fbtG on line 3 Array ( [1] => 2 [x] => y [p] => q )
Output for 4.3.0 - 7.1.20
Notice: Use of undefined constant x - assumed 'x' in /in/6fbtG on line 3 Notice: Use of undefined constant y - assumed 'y' in /in/6fbtG on line 3 Notice: Use of undefined constant p - assumed 'p' in /in/6fbtG on line 3 Notice: Use of undefined constant q - assumed 'q' in /in/6fbtG on line 3 Array ( [1] => 2 [x] => y [p] => q )