3v4l.org

run code in 300+ PHP versions simultaneously
<?php $stringRegex = "/([aA][0-9]+)"; $schema = [ 'a26UserId', 'a17Passwd', 'cAccountChannel', 'a256PcInfo1' ]; $result = []; foreach ($schema as $currentType) { if (preg_match($stringRegex, $currentType, $matches)) { $result[] = $matches[1]; } else { $result[] = substr($currentType, 0, 1); } } print_r($result);
Output for git.master, git.master_jit, rfc.property-hooks
Warning: preg_match(): No ending delimiter '/' found in /in/buVJU on line 14 Warning: preg_match(): No ending delimiter '/' found in /in/buVJU on line 14 Warning: preg_match(): No ending delimiter '/' found in /in/buVJU on line 14 Warning: preg_match(): No ending delimiter '/' found in /in/buVJU on line 14 Array ( [0] => a [1] => a [2] => c [3] => a )

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:
51.07 ms | 402 KiB | 8 Q