3v4l.org

run code in 300+ PHP versions simultaneously
<?php $strings = [ 'Stack Over Flow Abcpqr (UR)', 'Fluency in English Conversation Defklmno (1WIR)', 'English Proficiency GHI (2WIR)', 'Testing ADG (3WIR)', ]; function implodeNotLastTwoElements($string) { $array = explode(' ', $string); return [implode(' ', array_slice($array, 0, -2))] + array_slice($array, -3); } foreach ($strings as $string) { echo json_encode(implodeNotLastTwoElements($string)) . "\n"; }
Output for git.master, git.master_jit, rfc.property-hooks
["Stack Over Flow","Abcpqr","(UR)"] ["Fluency in English Conversation","Defklmno","(1WIR)"] ["English Proficiency","GHI","(2WIR)"] ["Testing","ADG","(3WIR)"]

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