3v4l.org

run code in 300+ 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;
Output for 7.2.8
matching characters: l, o 0.0072002410888672 matching characters: l, o 0.00040531158447266
Output for 7.2.7
matching characters: l, o 0.17530918121338 matching characters: l, o 0.0046014785766602
Output for 7.2.6
matching characters: l, o 0.0047922134399414 matching characters: l, o 0.00050067901611328
Output for 7.2.5
matching characters: l, o 0.0051975250244141 matching characters: l, o 0.00040531158447266
Output for 7.2.4
matching characters: l, o 0.0049114227294922 matching characters: l, o 0.00050067901611328
Output for 7.2.3
matching characters: l, o 0.82049369812012 matching characters: l, o 0.0020980834960938
Output for 7.2.2
matching characters: l, o 0.0070095062255859 matching characters: l, o 0.00069141387939453
Output for 7.2.1
matching characters: l, o 0.0048160552978516 matching characters: l, o 0.00050067901611328
Output for 7.2.0
matching characters: l, o 0.0086069107055664 matching characters: l, o 0.0018119812011719
Output for 7.1.20
matching characters: l, o 0.69749355316162 matching characters: l, o 0.0060081481933594
Output for 7.1.19
matching characters: l, o 0.66101551055908 matching characters: l, o 0.0036954879760742
Output for 7.1.18
matching characters: l, o 0.0030040740966797 matching characters: l, o 0.00040531158447266
Output for 7.1.17
matching characters: l, o 0.0066995620727539 matching characters: l, o 0.002288818359375
Output for 7.1.16
matching characters: l, o 0.22859573364258 matching characters: l, o 0.00088214874267578
Output for 7.1.15
matching characters: l, o 0.0034093856811523 matching characters: l, o 0.0013828277587891
Output for 7.1.14
matching characters: l, o 0.0087976455688477 matching characters: l, o 0.0042915344238281
Output for 7.1.13
matching characters: l, o 0.0076055526733398 matching characters: l, o 0.0024080276489258
Output for 7.1.12
matching characters: l, o 0.0078916549682617 matching characters: l, o 0.007319450378418
Output for 7.1.11
matching characters: l, o 0.0082015991210938 matching characters: l, o 0.0043869018554688
Output for 7.1.10
matching characters: l, o 0.0024080276489258 matching characters: l, o 0.00040531158447266
Output for 7.1.9
matching characters: l, o 0.0080108642578125 matching characters: l, o 0.0010013580322266
Output for 7.1.8
matching characters: l, o 0.0038862228393555 matching characters: l, o 0.0015020370483398
Output for 7.1.7
matching characters: l, o 0.0034093856811523 matching characters: l, o 0.0014066696166992
Output for 7.1.6
matching characters: l, o 0.0027179718017578 matching characters: l, o 0.15799999237061
Output for 7.1.5
matching characters: l, o 0.012898445129395 matching characters: l, o 0.0049114227294922
Output for 7.1.4
matching characters: l, o 0.002598762512207 matching characters: l, o 0.00078678131103516
Output for 7.1.3
matching characters: l, o 0.0019073486328125 matching characters: l, o 0.00078678131103516
Output for 7.1.2
matching characters: l, o 0.0026941299438477 matching characters: l, o 0.0010013580322266
Output for 7.1.1
matching characters: l, o 0.010991096496582 matching characters: l, o 0.0056028366088867
Output for 7.1.0
matching characters: l, o 0.0034093856811523 matching characters: l, o 0.0040054321289062

preferences:
67.94 ms | 446 KiB | 5 Q