3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = '# (811) (1485) [2756] {29} [555] {15} # (811) (1476) {20} {15} (1485) [196] [2441] # (911) (619) {19} (1476) [2765] [2752] {21}'; foreach (explode("\n", $str) as $str) { $result = array_reduce(explode(" ", $str), function($acc, $curr) { preg_match("/{(?!19|20)\d+}/", $curr) ? $acc['move'][] = $curr : $acc['valid'][] = $curr; return $acc; }, ['valid' => [], 'move' => []]); echo implode(" ", array_merge($result['valid'], array_reverse($result['move']))) . PHP_EOL; }
Output for git.master, git.master_jit, rfc.property-hooks
# (811) (1485) [2756] [555] {15} {29} # (811) (1476) {20} (1485) [196] [2441] {15} # (911) (619) {19} (1476) [2765] [2752] {21}

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