3v4l.org

run code in 500+ PHP versions simultaneously
<?php $a = "Hello"; $b = "world"; $matching = array_unique(array_intersect(str_split(strtolower($a)), str_split(strtolower($b)))); $t = microtime(true); if($matching) echo "\nmatching characters: " . implode(", ", $matching); echo "\n" . (microtime(true)-$t)*100; $s = microtime(true); if(count($matching)>0) echo "\nmatching characters: " . implode(", ", $matching); echo "\n" . (microtime(true)-$s)*100;

preferences:
59.9 ms | 771 KiB | 5 Q