3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types = 1); /** * @return list<string> */ function generateList(string $name): array { $a = ['a', 'b', 'c', $name]; $b = ['d', 'e']; array_splice($a, 2, 0, $b); return $a; } $l = generateList('John'); var_dump(array_is_list($l)); var_dump($l);
Output for git.master, git.master_jit
bool(true) array(6) { [0]=> string(1) "a" [1]=> string(1) "b" [2]=> string(1) "d" [3]=> string(1) "e" [4]=> string(1) "c" [5]=> string(4) "John" }

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:
65.19 ms | 405 KiB | 5 Q