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)))); $s = microtime(true); if(count($matching)>0) echo "\nmatching characters: " . implode(", ", $matching); echo "\n" . (microtime(true)-$s)*100; $t = microtime(true); if($matching) echo "\nmatching characters: " . implode(", ", $matching); echo "\n" . (microtime(true)-$t)*100;

preferences:
45.7 ms | 607 KiB | 5 Q