3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php declare(strict_types=1); $pos = array_search('a', ['b'], true); var_dump(array_slice(['c'], $pos));
Output for 7.3.0alpha1 - 7.3.0beta1
Fatal error: Uncaught TypeError: array_slice() expects parameter 2 to be int, bool given in /in/IaTNY:6 Stack trace: #0 /in/IaTNY(6): array_slice(Array, false) #1 {main} thrown in /in/IaTNY on line 6
Process exited with code 255.
Output for 7.0.0 - 7.2.6
Fatal error: Uncaught TypeError: array_slice() expects parameter 2 to be integer, boolean given in /in/IaTNY:6 Stack trace: #0 /in/IaTNY(6): array_slice(Array, false) #1 {main} thrown in /in/IaTNY on line 6
Process exited with code 255.
Output for hhvm-3.22.0
Fatal error: Uncaught TypeError: Argument 2 passed to array_slice() must be an instance of int, bool given in /in/IaTNY:-1 Stack trace: #0 /in/IaTNY(-1): array_slice() #1 {main}
Process exited with code 255.
Output for hhvm-3.21.3
Fatal error: Uncaught TypeError: Argument 2 passed to array_slice() must be an instance of int, bool given in /in/IaTNY:6 Stack trace: #0 /in/IaTNY(6): array_slice() #1 {main}
Process exited with code 255.
Output for hhvm-3.18.5
Fatal error: Uncaught TypeError: Argument 2 passed to array_slice() must be an instance of int, bool given in /in/IaTNY:6 Stack trace: #0 {main}
Process exited with code 255.
Output for 5.6.0 - 5.6.30
Warning: Unsupported declare 'strict_types' in /in/IaTNY on line 3 array(1) { [0]=> string(1) "c" }