3v4l.org

run code in 300+ PHP versions simultaneously
<?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.2.0
Starting array_diff array_diff() took 0.046 seconds and returned 160000 entries
Output for 7.1.7
Starting array_diff array_diff() took 0.024 seconds and returned 160000 entries
Output for 7.1.6
Starting array_diff array_diff() took 0.040 seconds and returned 160000 entries
Output for 7.0.5, 7.1.5
Starting array_diff array_diff() took 0.031 seconds and returned 160000 entries
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.20

Process exited with code 137.
Output for 7.0.6
Starting array_diff array_diff() took 0.036 seconds and returned 160000 entries
Output for 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 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.24 - 5.5.35, 5.6.8 - 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.2 - 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 4.3.3, 4.3.7 - 4.3.8, 4.3.10 - 4.3.11, 4.4.0 - 4.4.9, 5.0.0 - 5.0.1, 5.0.4 - 5.0.5, 5.1.1 - 5.1.6, 5.2.1
Starting array_diff
Process exited with code 137.
Output for 5.2.0
Starting array_diff array_diff() took 0.972 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.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 4.3.9
Starting array_diff array_diff() took -0.022 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.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

preferences:
142.12 ms | 401 KiB | 174 Q