3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $b=array(-1=>0); $c=array_pop($b); var_dump($c); var_dump(array_push($b, 0)); var_dump(array_push($b, 0)); var_dump($b); var_dump(array_push($b, 0)); ?>
based on 2L3Oc
Output for 5.4.32 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
int(0) int(1) int(2) array(2) { [0]=> int(0) [1]=> int(0) } int(3)
Output for 5.2.10 - 5.4.31
int(0) int(1) int(2) array(2) { [-1]=> int(0) [9223372036854775807]=> int(0) } Warning: array_push(): Cannot add element to the array as the next element is already occupied in /in/jd8Rq on line 8 bool(false)
Output for 4.3.0 - 5.2.9
int(0) int(1) int(2) array(2) { [-1]=> int(0) [0]=> int(0) } int(3)