3v4l.org

run code in 300+ PHP versions simultaneously
<?php $strings = [ "age<21,length>10,height<>10,width!=100,name='Emma Einarsson' or it can be words time>=10,clouds<=4", "age < 21, length > 10, height <> 10, width != 100, name = 'Emma Einarsson' or it can be words time >= 10, clouds <= 4", "My name is Emma and i have a dillemma, what's the distance between 'New York' and 'Athene' ?", "'New York' and London at the start and end with Paris and 'Los Angeles'" ]; foreach ($strings as $string) { var_export(preg_match_all("~\B'\K(?:[^']+)|\b[a-z']+\b|\d+|[<>!=?]+~i", $string, $out) ? $out[0] : 'fail'); echo "\n"; }
Output for git.master, git.master_jit, rfc.property-hooks
array ( 0 => 'age', 1 => '<', 2 => '21', 3 => 'length', 4 => '>', 5 => '10', 6 => 'height', 7 => '<>', 8 => '10', 9 => 'width', 10 => '!=', 11 => '100', 12 => 'name', 13 => '=', 14 => 'Emma Einarsson', 15 => 'or', 16 => 'it', 17 => 'can', 18 => 'be', 19 => 'words', 20 => 'time', 21 => '>=', 22 => '10', 23 => 'clouds', 24 => '<=', 25 => '4', ) array ( 0 => 'age', 1 => '<', 2 => '21', 3 => 'length', 4 => '>', 5 => '10', 6 => 'height', 7 => '<>', 8 => '10', 9 => 'width', 10 => '!=', 11 => '100', 12 => 'name', 13 => '=', 14 => 'Emma Einarsson', 15 => 'or', 16 => 'it', 17 => 'can', 18 => 'be', 19 => 'words', 20 => 'time', 21 => '>=', 22 => '10', 23 => 'clouds', 24 => '<=', 25 => '4', ) array ( 0 => 'My', 1 => 'name', 2 => 'is', 3 => 'Emma', 4 => 'and', 5 => 'i', 6 => 'have', 7 => 'a', 8 => 'dillemma', 9 => 'what\'s', 10 => 'the', 11 => 'distance', 12 => 'between', 13 => 'New York', 14 => 'and', 15 => 'Athene', 16 => '?', ) array ( 0 => 'New York', 1 => 'and', 2 => 'London', 3 => 'at', 4 => 'the', 5 => 'start', 6 => 'and', 7 => 'end', 8 => 'with', 9 => 'Paris', 10 => 'and', 11 => 'Los Angeles', )

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:
28.91 ms | 409 KiB | 5 Q