3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $i=0; $j=9500000; while($i < 60000) { $i++; $j++; $data1[] = md5($i); $data2[] = md5($j); } $time = microtime(true); echo "Starting array_diff\n"; $data_diff1 = array_diff($data1, $data2); $time = microtime(true) - $time; echo 'array_diff() took ' . number_format($time, 3) . ' seconds and returned ' . count($data_diff1) . " entries\n";
Output for 7.1.7 - 7.2.0
Starting array_diff array_diff() took 0.011 seconds and returned 60000 entries
Output for 7.1.6
Starting array_diff array_diff() took 0.072 seconds and returned 60000 entries
Output for 7.1.5
Starting array_diff array_diff() took 0.041 seconds and returned 60000 entries
Output for 5.3.21, 7.0.20
Starting array_diff array_diff() took 0.329 seconds and returned 60000 entries
Output for 5.3.16, 5.4.27
Starting array_diff array_diff() took 0.295 seconds and returned 60000 entries
Output for 5.4.26
Starting array_diff array_diff() took 0.335 seconds and returned 60000 entries
Output for 5.4.25
Starting array_diff array_diff() took 0.293 seconds and returned 60000 entries
Output for 5.4.24
Starting array_diff array_diff() took 0.281 seconds and returned 60000 entries
Output for 5.4.23
Starting array_diff array_diff() took 0.272 seconds and returned 60000 entries
Output for 5.4.22
Starting array_diff array_diff() took 0.266 seconds and returned 60000 entries
Output for 5.4.13, 5.4.15, 5.4.21
Starting array_diff array_diff() took 0.242 seconds and returned 60000 entries
Output for 5.4.20
Starting array_diff array_diff() took 0.239 seconds and returned 60000 entries
Output for 5.4.19
Starting array_diff array_diff() took 0.244 seconds and returned 60000 entries
Output for 5.4.18
Starting array_diff array_diff() took 0.317 seconds and returned 60000 entries
Output for 5.4.17
Starting array_diff array_diff() took 0.238 seconds and returned 60000 entries
Output for 5.3.17, 5.4.16
Starting array_diff array_diff() took 0.276 seconds and returned 60000 entries
Output for 5.4.14
Starting array_diff array_diff() took 0.246 seconds and returned 60000 entries
Output for 5.4.12
Starting array_diff array_diff() took 0.371 seconds and returned 60000 entries
Output for 5.4.11
Starting array_diff array_diff() took 0.249 seconds and returned 60000 entries
Output for 5.4.10
Starting array_diff array_diff() took 0.268 seconds and returned 60000 entries
Output for 5.4.9
Starting array_diff array_diff() took 0.389 seconds and returned 60000 entries
Output for 5.4.8
Starting array_diff array_diff() took 0.369 seconds and returned 60000 entries
Output for 5.3.28, 5.4.7
Starting array_diff array_diff() took 0.245 seconds and returned 60000 entries
Output for 5.4.6
Starting array_diff array_diff() took 0.360 seconds and returned 60000 entries
Output for 5.4.5
Starting array_diff array_diff() took 0.241 seconds and returned 60000 entries
Output for 5.4.4
Starting array_diff array_diff() took 0.236 seconds and returned 60000 entries
Output for 5.4.3
Starting array_diff array_diff() took 0.228 seconds and returned 60000 entries
Output for 5.4.2
Starting array_diff array_diff() took 0.269 seconds and returned 60000 entries
Output for 5.4.0 - 5.4.1
Starting array_diff array_diff() took 0.370 seconds and returned 60000 entries
Output for 5.3.27
Starting array_diff array_diff() took 0.199 seconds and returned 60000 entries
Output for 5.3.26
Starting array_diff array_diff() took 0.330 seconds and returned 60000 entries
Output for 5.3.25
Starting array_diff array_diff() took 0.214 seconds and returned 60000 entries
Output for 5.3.18, 5.3.24
Starting array_diff array_diff() took 0.223 seconds and returned 60000 entries
Output for 5.3.23
Starting array_diff array_diff() took 0.204 seconds and returned 60000 entries
Output for 5.3.22
Starting array_diff array_diff() took 0.258 seconds and returned 60000 entries
Output for 5.3.20
Starting array_diff array_diff() took 0.265 seconds and returned 60000 entries
Output for 5.3.19
Starting array_diff array_diff() took 0.224 seconds and returned 60000 entries
Output for 5.3.15
Starting array_diff array_diff() took 0.308 seconds and returned 60000 entries
Output for 5.3.14
Starting array_diff array_diff() took 0.274 seconds and returned 60000 entries
Output for 5.3.13
Starting array_diff array_diff() took 0.197 seconds and returned 60000 entries
Output for 5.3.12
Starting array_diff array_diff() took 0.289 seconds and returned 60000 entries
Output for 5.3.11
Starting array_diff array_diff() took 0.267 seconds and returned 60000 entries
Output for 5.3.10
Starting array_diff array_diff() took 0.275 seconds and returned 60000 entries
Output for 5.3.9
Starting array_diff array_diff() took 0.210 seconds and returned 60000 entries
Output for 5.3.8
Starting array_diff array_diff() took 0.212 seconds and returned 60000 entries
Output for 5.3.7
Starting array_diff array_diff() took 0.206 seconds and returned 60000 entries