3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php foreach (range(0, 4) as $len) { echo "$len: ------------\n"; $list = array_fill(0, $len, 42); $first = array_slice($list, 0, 3); $rest = array_slice($list, 3); var_dup($first, $rest); }
Output for 7.0.0 - 7.2.0
0: ------------ Fatal error: Uncaught Error: Call to undefined function var_dup() in /in/IpnG6:7 Stack trace: #0 {main} thrown in /in/IpnG6 on line 7
Process exited with code 255.
Output for 5.6.8 - 5.6.28
0: ------------ Fatal error: Call to undefined function var_dup() in /in/IpnG6 on line 7
Process exited with code 255.
Output for 5.3.19 - 5.5.35
0: ------------ Warning: array_fill(): Number of elements must be positive in /in/IpnG6 on line 4 Warning: array_slice() expects parameter 1 to be array, boolean given in /in/IpnG6 on line 5 Warning: array_slice() expects parameter 1 to be array, boolean given in /in/IpnG6 on line 6 Fatal error: Call to undefined function var_dup() in /in/IpnG6 on line 7
Process exited with code 255.