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, join_words($words)); $result = array_merge($result, join_words(array_reverse($words))); print_r($result);
Output for rfc.property-hooks, git.master, git.master_jit
Array ( [0] => THIS [1] => THIS IS [2] => THIS IS AN [3] => THIS IS AN EXAMPLE [4] => EXAMPLE [5] => EXAMPLE AN [6] => EXAMPLE AN IS [7] => EXAMPLE AN IS THIS )

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:
45.2 ms | 1552 KiB | 4 Q