3v4l.org

run code in 300+ PHP versions simultaneously
<?php $team1="U23 Benfica:Vitoria Guimaraes"; $team2="Benfica (U23):Vitoria Guimaraes U23"; var_dump(match($team1, $team2)); $team1="U23 Benfica:Vitoria Guimaraes"; $team2="Benfica U23:Vitoria Guimaraes(U23)"; var_dump(match($team1, $team2)); $team1="Benfica U23:Vitoria Guimaraes(U23)"; $team2="Benfica (U23):Vitoria Guimaraes U23"; var_dump(match($team1, $team2)); function match($s1, $s2){ $s1 = str_replace(["(",")"], " ", $s1); $s2 = str_replace(["(",")"], " ", $s2); $delimiters = [" ", ":"]; $arr1 = array_filter(multiexplode($delimiters,$s1)); $arr2 = array_filter(multiexplode($delimiters,$s2)); //var_dump($arr1, $arr2); $intersect = count(array_unique(array_intersect($arr1, $arr2))); if($intersect == count(array_unique($arr1)) && $intersect == count(array_unique($arr2))){ return true; }else{ return false; } } function multiexplode ($delimiters,$string) { $ready = str_replace($delimiters, $delimiters[0], $string); $launch = explode($delimiters[0], $ready); return $launch; }
Output for git.master, git.master_jit, rfc.property-hooks
Parse error: syntax error, unexpected token "," in /in/MY7j7 on line 5
Process exited with code 255.

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