3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); $pos = array_search('a', ['b'], true); var_dump(array_slice(['c'], $pos));
Output for 8.3.0 - 8.3.4
Fatal error: Uncaught TypeError: array_slice(): Argument #2 ($offset) must be of type int, false 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 8.0.0 - 8.0.30, 8.1.0 - 8.1.27, 8.2.0 - 8.2.17
Fatal error: Uncaught TypeError: array_slice(): Argument #2 ($offset) must be of type 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.3.0 - 7.3.33, 7.4.0 - 7.4.33
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.1.0 - 7.1.33, 7.2.0 - 7.2.33
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.

preferences:
166.45 ms | 402 KiB | 185 Q