3v4l.org

run code in 150+ 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 5.4.9, 5.4.13, 5.4.18, 5.4.27
Starting array_diff array_diff() took 0.213 seconds and returned 60000 entries
Output for 5.4.24, 5.4.26
Starting array_diff array_diff() took 0.218 seconds and returned 60000 entries
Output for 5.3.9, 5.4.25
Starting array_diff array_diff() took 0.206 seconds and returned 60000 entries
Output for 5.3.14, 5.4.23
Starting array_diff array_diff() took 0.201 seconds and returned 60000 entries
Output for 5.4.21 - 5.4.22
Starting array_diff array_diff() took 0.186 seconds and returned 60000 entries
Output for 5.4.20
Starting array_diff array_diff() took 0.237 seconds and returned 60000 entries
Output for 5.4.19
Starting array_diff array_diff() took 0.209 seconds and returned 60000 entries
Output for 5.4.17
Starting array_diff array_diff() took 0.204 seconds and returned 60000 entries
Output for 5.3.23, 5.4.16
Starting array_diff array_diff() took 0.196 seconds and returned 60000 entries
Output for 5.4.15
Starting array_diff array_diff() took 0.190 seconds and returned 60000 entries
Output for 5.4.14
Starting array_diff array_diff() took 0.219 seconds and returned 60000 entries
Output for 5.4.12
Starting array_diff array_diff() took 0.191 seconds and returned 60000 entries
Output for 5.4.11
Starting array_diff array_diff() took 0.273 seconds and returned 60000 entries
Output for 5.4.10
Starting array_diff array_diff() took 0.226 seconds and returned 60000 entries
Output for 5.4.8
Starting array_diff array_diff() took 0.235 seconds and returned 60000 entries
Output for 5.4.0, 5.4.7
Starting array_diff array_diff() took 0.296 seconds and returned 60000 entries
Output for 5.4.5 - 5.4.6
Starting array_diff array_diff() took 0.266 seconds and returned 60000 entries
Output for 5.4.4
Starting array_diff array_diff() took 0.321 seconds and returned 60000 entries
Output for 5.4.3
Starting array_diff array_diff() took 0.238 seconds and returned 60000 entries
Output for 5.4.2
Starting array_diff array_diff() took 0.251 seconds and returned 60000 entries
Output for 5.4.1
Starting array_diff array_diff() took 0.229 seconds and returned 60000 entries
Output for 5.3.20, 5.3.28
Starting array_diff array_diff() took 0.184 seconds and returned 60000 entries
Output for 5.3.27
Starting array_diff array_diff() took 0.265 seconds and returned 60000 entries
Output for 5.3.26
Starting array_diff array_diff() took 0.195 seconds and returned 60000 entries
Output for 5.3.25
Starting array_diff array_diff() took 0.197 seconds and returned 60000 entries
Output for 5.3.24
Starting array_diff array_diff() took 0.217 seconds and returned 60000 entries
Output for 5.3.22
Starting array_diff array_diff() took 0.193 seconds and returned 60000 entries
Output for 5.3.21
Starting array_diff array_diff() took 0.207 seconds and returned 60000 entries
Output for 5.3.19
Starting array_diff array_diff() took 0.239 seconds and returned 60000 entries
Output for 5.3.18
Starting array_diff array_diff() took 0.171 seconds and returned 60000 entries
Output for 5.3.17
Starting array_diff array_diff() took 0.163 seconds and returned 60000 entries
Output for 5.3.16
Starting array_diff array_diff() took 0.177 seconds and returned 60000 entries
Output for 5.3.15
Starting array_diff array_diff() took 0.178 seconds and returned 60000 entries
Output for 5.3.13
Starting array_diff array_diff() took 0.202 seconds and returned 60000 entries
Output for 5.3.12
Starting array_diff array_diff() took 0.216 seconds and returned 60000 entries
Output for 5.3.11
Starting array_diff array_diff() took 0.212 seconds and returned 60000 entries
Output for 5.3.10
Starting array_diff array_diff() took 0.233 seconds and returned 60000 entries
Output for 5.3.8
Starting array_diff array_diff() took 0.172 seconds and returned 60000 entries
Output for 5.3.7
Starting array_diff array_diff() took 0.183 seconds and returned 60000 entries