3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $i=0; $j=5500000; while($i < 160000) { $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.0.0, 7.0.14 - 7.1.0
Starting array_diff array_diff() took 0.030 seconds and returned 160000 entries
Output for 7.0.6
Starting array_diff array_diff() took 0.036 seconds and returned 160000 entries
Output for 7.0.5
Starting array_diff array_diff() took 0.031 seconds and returned 160000 entries
Output for hhvm-3.10.0, 7.0.4
Starting array_diff array_diff() took 0.032 seconds and returned 160000 entries
Output for 7.0.3
Starting array_diff array_diff() took 0.048 seconds and returned 160000 entries
Output for 7.0.2
Starting array_diff array_diff() took 0.047 seconds and returned 160000 entries
Output for 7.0.1
Starting array_diff array_diff() took 0.029 seconds and returned 160000 entries
Output for hhvm-3.12.0
Starting array_diff array_diff() took 0.046 seconds and returned 160000 entries
Output for 5.3.0 - 5.6.28
Starting array_diff Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 1280008 bytes) in /in/Ev21W on line 12
Process exited with code 255.
Output for 5.2.1 - 5.2.17
Starting array_diff Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 2097152 bytes) in /in/Ev21W on line 12
Process exited with code 255.
Output for 5.2.0
Starting array_diff array_diff() took 0.911 seconds and returned 160000 entries
Output for 5.1.6
Starting array_diff array_diff() took 0.819 seconds and returned 160000 entries
Output for 5.1.5
Starting array_diff array_diff() took 0.866 seconds and returned 160000 entries
Output for 5.1.4
Starting array_diff array_diff() took 0.920 seconds and returned 160000 entries
Output for 5.1.3
Starting array_diff array_diff() took 0.845 seconds and returned 160000 entries
Output for 5.1.2
Starting array_diff array_diff() took 0.750 seconds and returned 160000 entries
Output for 5.1.1
Starting array_diff array_diff() took 0.917 seconds and returned 160000 entries
Output for 5.1.0
Starting array_diff array_diff() took 1.234 seconds and returned 160000 entries
Output for 5.0.4 - 5.0.5
Starting array_diff
Process exited with code 137.
Output for 5.0.3
Starting array_diff array_diff() took 1.126 seconds and returned 160000 entries
Output for 5.0.2
Starting array_diff array_diff() took 1.196 seconds and returned 160000 entries
Output for 5.0.1
Starting array_diff array_diff() took 0.730 seconds and returned 160000 entries
Output for 5.0.0
Starting array_diff array_diff() took 0.816 seconds and returned 160000 entries
Output for 4.4.9
Starting array_diff array_diff() took -0.199 seconds and returned 160000 entries
Output for 4.4.8
Starting array_diff array_diff() took -0.236 seconds and returned 160000 entries
Output for 4.4.7
Starting array_diff array_diff() took -0.142 seconds and returned 160000 entries
Output for 4.4.6
Starting array_diff array_diff() took -0.208 seconds and returned 160000 entries
Output for 4.4.5
Starting array_diff array_diff() took -0.140 seconds and returned 160000 entries
Output for 4.4.4
Starting array_diff array_diff() took -0.273 seconds and returned 160000 entries
Output for 4.4.3
Starting array_diff array_diff() took 0.820 seconds and returned 160000 entries
Output for 4.4.2
Starting array_diff array_diff() took -0.075 seconds and returned 160000 entries
Output for 4.4.1
Starting array_diff array_diff() took -0.119 seconds and returned 160000 entries
Output for 4.4.0
Starting array_diff array_diff() took -0.046 seconds and returned 160000 entries
Output for 4.3.11
Starting array_diff array_diff() took -0.166 seconds and returned 160000 entries
Output for 4.3.10
Starting array_diff array_diff() took -0.133 seconds and returned 160000 entries
Output for 4.3.9
Starting array_diff array_diff() took -0.022 seconds and returned 160000 entries
Output for 4.3.8
Starting array_diff array_diff() took -0.165 seconds and returned 160000 entries
Output for 4.3.7
Starting array_diff array_diff() took -0.023 seconds and returned 160000 entries
Output for 4.3.6
Starting array_diff array_diff() took 0.055 seconds and returned 160000 entries
Output for 4.3.5
Starting array_diff array_diff() took -0.768 seconds and returned 160000 entries
Output for 4.3.4
Starting array_diff array_diff() took 0.918 seconds and returned 160000 entries
Output for 4.3.3
Starting array_diff array_diff() took 0.082 seconds and returned 160000 entries
Output for 4.3.2
Starting array_diff array_diff() took 0.018 seconds and returned 160000 entries
Output for 4.3.1
Starting array_diff array_diff() took 0.016 seconds and returned 160000 entries
Output for 4.3.0
Starting array_diff array_diff() took -0.844 seconds and returned 160000 entries