3v4l.org

run code in 300+ PHP versions simultaneously
<?php function join_words($words) { $return = []; for ($i=0; $i < count($words); $i++) { $return[] = implode(' ', array_slice($words, 0, $i+1)); } return $return; } $words = ['THIS', 'IS', 'AN', 'EXAMPLE']; $result = []; $result = array_merge($result, array_reverse(join_words($words))); $result = array_merge($result, array_reverse(join_words(array_reverse($words)))); print_r($result);
Output for rfc.property-hooks, git.master, git.master_jit
Array ( [0] => THIS IS AN EXAMPLE [1] => THIS IS AN [2] => THIS IS [3] => THIS [4] => EXAMPLE AN IS THIS [5] => EXAMPLE AN IS [6] => EXAMPLE AN [7] => EXAMPLE )

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:
96.58 ms | 1416 KiB | 4 Q