3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $i=0; $j=50000; 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.0
Starting array_diff array_diff() took 0.008 seconds and returned 50000 entries
Output for hhvm-3.10.0, 7.0.14
Starting array_diff array_diff() took 0.011 seconds and returned 50000 entries
Output for 7.0.0, 7.0.6
Starting array_diff array_diff() took 0.009 seconds and returned 50000 entries
Output for 7.0.5
Starting array_diff array_diff() took 0.010 seconds and returned 50000 entries
Output for 7.0.1, 7.0.4
Starting array_diff array_diff() took 0.012 seconds and returned 50000 entries
Output for 7.0.3
Starting array_diff array_diff() took 0.015 seconds and returned 50000 entries
Output for hhvm-3.12.0, 7.0.2
Starting array_diff array_diff() took 0.017 seconds and returned 50000 entries
Output for 5.6.28
Starting array_diff array_diff() took 0.046 seconds and returned 50000 entries
Output for 5.5.25, 5.6.20 - 5.6.21
Starting array_diff array_diff() took 0.154 seconds and returned 50000 entries
Output for 5.4.45, 5.6.19
Starting array_diff array_diff() took 0.143 seconds and returned 50000 entries
Output for 5.6.18
Starting array_diff array_diff() took 0.174 seconds and returned 50000 entries
Output for 5.6.17
Starting array_diff array_diff() took 0.145 seconds and returned 50000 entries
Output for 5.6.8, 5.6.16
Starting array_diff array_diff() took 0.133 seconds and returned 50000 entries
Output for 5.5.33, 5.6.15
Starting array_diff array_diff() took 0.149 seconds and returned 50000 entries
Output for 5.4.41, 5.6.14
Starting array_diff array_diff() took 0.137 seconds and returned 50000 entries
Output for 5.5.24, 5.5.35, 5.6.13
Starting array_diff array_diff() took 0.141 seconds and returned 50000 entries
Output for 5.6.12
Starting array_diff array_diff() took 0.150 seconds and returned 50000 entries
Output for 5.5.27, 5.5.32, 5.6.11
Starting array_diff array_diff() took 0.151 seconds and returned 50000 entries
Output for 5.4.40, 5.6.10
Starting array_diff array_diff() took 0.138 seconds and returned 50000 entries
Output for 5.6.9
Starting array_diff array_diff() took 0.146 seconds and returned 50000 entries
Output for 5.5.34
Starting array_diff array_diff() took 0.166 seconds and returned 50000 entries
Output for 5.5.31
Starting array_diff array_diff() took 0.139 seconds and returned 50000 entries
Output for 5.5.30
Starting array_diff array_diff() took 0.153 seconds and returned 50000 entries
Output for 5.5.29
Starting array_diff array_diff() took 0.155 seconds and returned 50000 entries
Output for 5.5.28
Starting array_diff array_diff() took 0.169 seconds and returned 50000 entries
Output for 5.4.42, 5.5.26
Starting array_diff array_diff() took 0.148 seconds and returned 50000 entries
Output for 5.4.44
Starting array_diff array_diff() took 0.142 seconds and returned 50000 entries
Output for 5.4.43
Starting array_diff array_diff() took 0.134 seconds and returned 50000 entries
Output for 5.4.39
Starting array_diff array_diff() took 0.324 seconds and returned 50000 entries
Output for 5.4.38
Starting array_diff array_diff() took 0.293 seconds and returned 50000 entries
Output for 5.4.37
Starting array_diff array_diff() took 0.292 seconds and returned 50000 entries
Output for 5.4.36
Starting array_diff array_diff() took 0.321 seconds and returned 50000 entries
Output for 5.4.35
Starting array_diff array_diff() took 0.307 seconds and returned 50000 entries
Output for 5.4.34
Starting array_diff array_diff() took 0.310 seconds and returned 50000 entries
Output for 5.4.32
Starting array_diff array_diff() took 0.257 seconds and returned 50000 entries
Output for 5.4.31
Starting array_diff array_diff() took 0.258 seconds and returned 50000 entries
Output for 5.4.30
Starting array_diff array_diff() took 0.278 seconds and returned 50000 entries
Output for 5.4.29
Starting array_diff array_diff() took 0.299 seconds and returned 50000 entries
Output for 5.4.4, 5.4.18, 5.4.28
Starting array_diff array_diff() took 0.259 seconds and returned 50000 entries
Output for 5.4.27
Starting array_diff array_diff() took 0.453 seconds and returned 50000 entries
Output for 5.4.26
Starting array_diff array_diff() took 0.556 seconds and returned 50000 entries
Output for 5.4.17, 5.4.25
Starting array_diff array_diff() took 0.263 seconds and returned 50000 entries
Output for 5.4.20, 5.4.24
Starting array_diff array_diff() took 0.288 seconds and returned 50000 entries
Output for 5.4.23
Starting array_diff array_diff() took 0.312 seconds and returned 50000 entries
Output for 5.4.22
Starting array_diff array_diff() took 0.303 seconds and returned 50000 entries
Output for 5.4.21
Starting array_diff array_diff() took 0.322 seconds and returned 50000 entries
Output for 5.4.19
Starting array_diff array_diff() took 0.268 seconds and returned 50000 entries
Output for 5.4.16
Starting array_diff array_diff() took 0.304 seconds and returned 50000 entries
Output for 5.4.11, 5.4.15
Starting array_diff array_diff() took 0.281 seconds and returned 50000 entries
Output for 5.4.14
Starting array_diff array_diff() took 0.314 seconds and returned 50000 entries
Output for 5.3.6, 5.4.13
Starting array_diff array_diff() took 0.290 seconds and returned 50000 entries
Output for 5.3.9, 5.3.26, 5.4.12
Starting array_diff array_diff() took 0.297 seconds and returned 50000 entries
Output for 5.4.10
Starting array_diff array_diff() took 0.229 seconds and returned 50000 entries
Output for 5.4.9
Starting array_diff array_diff() took 0.283 seconds and returned 50000 entries
Output for 5.4.8
Starting array_diff array_diff() took 0.270 seconds and returned 50000 entries
Output for 5.4.7
Starting array_diff array_diff() took 0.276 seconds and returned 50000 entries
Output for 5.4.6
Starting array_diff array_diff() took 0.323 seconds and returned 50000 entries
Output for 5.4.5
Starting array_diff array_diff() took 0.316 seconds and returned 50000 entries
Output for 5.3.17, 5.4.3
Starting array_diff array_diff() took 0.275 seconds and returned 50000 entries
Output for 5.3.22, 5.4.2
Starting array_diff array_diff() took 0.245 seconds and returned 50000 entries
Output for 5.4.1
Starting array_diff array_diff() took 0.344 seconds and returned 50000 entries
Output for 5.3.29 - 5.4.0
Starting array_diff array_diff() took 0.235 seconds and returned 50000 entries
Output for 5.3.25, 5.3.28
Starting array_diff array_diff() took 0.260 seconds and returned 50000 entries
Output for 5.3.27
Starting array_diff array_diff() took 0.238 seconds and returned 50000 entries
Output for 5.3.24
Starting array_diff array_diff() took 0.291 seconds and returned 50000 entries
Output for 5.3.23
Starting array_diff array_diff() took 0.252 seconds and returned 50000 entries
Output for 5.3.21
Starting array_diff array_diff() took 0.242 seconds and returned 50000 entries
Output for 5.3.20
Starting array_diff array_diff() took 0.241 seconds and returned 50000 entries
Output for 5.3.19
Starting array_diff array_diff() took 0.224 seconds and returned 50000 entries
Output for 5.3.18
Starting array_diff array_diff() took 0.271 seconds and returned 50000 entries
Output for 5.3.16
Starting array_diff array_diff() took 0.248 seconds and returned 50000 entries
Output for 5.3.15
Starting array_diff array_diff() took 0.272 seconds and returned 50000 entries
Output for 5.3.14
Starting array_diff array_diff() took 0.251 seconds and returned 50000 entries
Output for 5.3.13
Starting array_diff array_diff() took 0.279 seconds and returned 50000 entries
Output for 5.3.12
Starting array_diff array_diff() took 0.287 seconds and returned 50000 entries
Output for 5.3.11
Starting array_diff array_diff() took 0.277 seconds and returned 50000 entries
Output for 5.3.10
Starting array_diff array_diff() took 0.341 seconds and returned 50000 entries
Output for 5.3.8
Starting array_diff array_diff() took 0.294 seconds and returned 50000 entries
Output for 5.3.7
Starting array_diff array_diff() took 0.222 seconds and returned 50000 entries