3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "1A1R0A"; var_export(preg_match_all('~(\d)\K\D~', $string, $out) ? [$out[1], $out[0]] : [[], []]); echo "\n--- or ---\n"; [$letters, $numbers] = preg_match_all('~(\d)\K\D~', $string, $out) ? $out : [[], []]; var_export($numbers); echo "\n"; var_export($letters);
Output for git.master, git.master_jit, rfc.property-hooks
array ( 0 => array ( 0 => '1', 1 => '1', 2 => '0', ), 1 => array ( 0 => 'A', 1 => 'R', 2 => 'A', ), ) --- or --- array ( 0 => '1', 1 => '1', 2 => '0', ) array ( 0 => 'A', 1 => 'R', 2 => '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:
113.09 ms | 406 KiB | 5 Q