3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $arr = $arr2 = []; $count = 100000; for ($i = $count; $i >= 0; --$i) { $arr[$i] = rand(0, PHP_INT_MAX); } for ($i = $count / 10000; $i >= 0; --$i) { $arr2[ rand(0, PHP_INT_MAX) ] = true; } $t = microtime(true); $arr = array_flip($arr); $result = array_intersect_key($arr2, $arr); var_dump(microtime(true) - $t);
based on icUce
Output for 7.1.0
float(0.0019679069519043)
Output for 5.4.0 - 7.0.14

Process exited with code 137.
Output for 5.3.9 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/tiDSb on line 3
Process exited with code 255.