3v4l.org

run code in 300+ PHP versions simultaneously
<?php $re = '/^(#\h*)((\[\d+]|\{\d+}|\(\d+\))(?:\h+(?3))*)$/m'; $str = '# [1] {1} [2] {10} [3] [3] [4] {10} {100} [1] [5] # [5] {1} [6] (10) (20) (10) {10} [7] [5] [6] {10} {100} [8] [5] (10) (30) # (10) (30) [7] {1} [8] {10} [9] [7] [8] {100} {101} [9] [5] {101} (50)'; preg_match_all($re, $str, $matches, PREG_SET_ORDER, 0); echo implode("\n", array_map(fn($x) => $x[1] . implode(' ', array_unique(explode(' ', $x[2]))), $matches));
Output for git.master, git.master_jit, rfc.property-hooks
# [1] {1} [2] {10} [3] [4] {100} [5] # [5] {1} [6] (10) (20) {10} [7] {100} [8] (30) # (10) (30) [7] {1} [8] {10} [9] {100} {101} [5] (50)

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