3v4l.org

run code in 300+ PHP versions simultaneously
<?php $posts = array("pt", "r", "bp"); $postsnew = array_slice($posts, 0, 3); $output = array_slice($input, -2, 1); // returns "d" $output = array_slice($input, 0, 3); // returns "a", "b", and "c" print_r(array_slice($posts, 0, 3)); ?>
Output for git.master, git.master_jit, rfc.property-hooks
Warning: Undefined variable $input in /in/ZXW7K on line 5 Fatal error: Uncaught TypeError: array_slice(): Argument #1 ($array) must be of type array, null given in /in/ZXW7K:5 Stack trace: #0 /in/ZXW7K(5): array_slice(NULL, -2, 1) #1 {main} thrown in /in/ZXW7K on line 5
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
46.18 ms | 401 KiB | 8 Q