3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $i=0; $j=5000; while($i < 6000) { $i++; $j++; $data1[] = md5($i); $data2[] = md5($j); } $time = microtime(true); echo "Starting array_diff\n"; for ($i = 0; $i < 100; $i++) { $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";
based on J8Kls
Output for 7.2.0
Starting array_diff array_diff() took 0.042 seconds and returned 5000 entries
Output for 7.0.2 - 7.0.3, 7.0.14, 7.1.0, 7.1.7
Starting array_diff array_diff() took 0.041 seconds and returned 5000 entries
Output for 7.1.6
Starting array_diff array_diff() took 0.051 seconds and returned 5000 entries
Output for 7.1.5
Starting array_diff array_diff() took 0.057 seconds and returned 5000 entries
Output for 7.0.20
Starting array_diff array_diff() took 0.030 seconds and returned 5000 entries
Output for 7.0.6
Starting array_diff array_diff() took 0.046 seconds and returned 5000 entries
Output for 7.0.1, 7.0.5
Starting array_diff array_diff() took 0.038 seconds and returned 5000 entries
Output for 7.0.4
Starting array_diff array_diff() took 0.036 seconds and returned 5000 entries
Output for 7.0.0
Starting array_diff array_diff() took 0.033 seconds and returned 5000 entries
Output for 5.6.28
Starting array_diff array_diff() took 0.071 seconds and returned 5000 entries
Output for 5.6.21
Starting array_diff array_diff() took 0.628 seconds and returned 5000 entries
Output for 5.3.16, 5.4.2, 5.4.5, 5.6.20
Starting array_diff array_diff() took 0.660 seconds and returned 5000 entries
Output for 5.3.14, 5.6.19
Starting array_diff array_diff() took 0.637 seconds and returned 5000 entries
Output for 5.6.18
Starting array_diff array_diff() took 0.646 seconds and returned 5000 entries
Output for 5.6.17
Starting array_diff array_diff() took 0.653 seconds and returned 5000 entries
Output for 5.6.16
Starting array_diff array_diff() took 0.639 seconds and returned 5000 entries
Output for 5.6.15
Starting array_diff array_diff() took 0.659 seconds and returned 5000 entries
Output for 5.6.14
Starting array_diff array_diff() took 0.700 seconds and returned 5000 entries
Output for 5.4.12, 5.4.44, 5.5.29, 5.6.13
Starting array_diff array_diff() took 0.673 seconds and returned 5000 entries
Output for 5.6.12
Starting array_diff array_diff() took 0.631 seconds and returned 5000 entries
Output for 5.6.11
Starting array_diff array_diff() took 0.629 seconds and returned 5000 entries
Output for 5.6.10
Starting array_diff array_diff() took 0.656 seconds and returned 5000 entries
Output for 5.6.9
Starting array_diff array_diff() took 0.663 seconds and returned 5000 entries
Output for 5.5.34, 5.6.8
Starting array_diff array_diff() took 0.632 seconds and returned 5000 entries
Output for 5.4.6, 5.6.7
Starting array_diff array_diff() took 0.640 seconds and returned 5000 entries
Output for 5.5.35
Starting array_diff array_diff() took 0.691 seconds and returned 5000 entries
Output for 5.5.33
Starting array_diff array_diff() took 0.634 seconds and returned 5000 entries
Output for 5.5.32
Starting array_diff array_diff() took 0.722 seconds and returned 5000 entries
Output for 5.5.31
Starting array_diff array_diff() took 0.655 seconds and returned 5000 entries
Output for 5.5.30
Starting array_diff array_diff() took 0.619 seconds and returned 5000 entries
Output for 5.4.4, 5.5.28
Starting array_diff array_diff() took 0.651 seconds and returned 5000 entries
Output for 5.5.27
Starting array_diff array_diff() took 0.682 seconds and returned 5000 entries
Output for 5.5.26
Starting array_diff array_diff() took 0.696 seconds and returned 5000 entries
Output for 5.4.41, 5.5.25
Starting array_diff array_diff() took 0.688 seconds and returned 5000 entries
Output for 5.5.24
Starting array_diff array_diff() took 0.724 seconds and returned 5000 entries
Output for 5.4.45
Starting array_diff array_diff() took 0.621 seconds and returned 5000 entries
Output for 5.4.43
Starting array_diff array_diff() took 0.618 seconds and returned 5000 entries
Output for 5.4.15, 5.4.42
Starting array_diff array_diff() took 0.662 seconds and returned 5000 entries
Output for 5.4.40
Starting array_diff array_diff() took 0.669 seconds and returned 5000 entries
Output for 5.4.39
Starting array_diff array_diff() took 0.835 seconds and returned 5000 entries
Output for 5.4.38
Starting array_diff array_diff() took 0.606 seconds and returned 5000 entries
Output for 5.4.37
Starting array_diff array_diff() took 0.613 seconds and returned 5000 entries
Output for 5.4.36
Starting array_diff array_diff() took 0.633 seconds and returned 5000 entries
Output for 5.4.35
Starting array_diff array_diff() took 0.624 seconds and returned 5000 entries
Output for 5.4.34
Starting array_diff array_diff() took 0.625 seconds and returned 5000 entries
Output for 5.4.32
Starting array_diff array_diff() took 1.239 seconds and returned 5000 entries
Output for 5.4.31
Starting array_diff array_diff() took 0.814 seconds and returned 5000 entries
Output for 5.4.30
Starting array_diff array_diff() took 1.046 seconds and returned 5000 entries
Output for 5.4.29
Starting array_diff array_diff() took 1.031 seconds and returned 5000 entries
Output for 5.4.28
Starting array_diff array_diff() took 1.331 seconds and returned 5000 entries
Output for 5.4.27
Starting array_diff array_diff() took 1.209 seconds and returned 5000 entries
Output for 5.4.26
Starting array_diff array_diff() took 1.006 seconds and returned 5000 entries
Output for 5.4.25
Starting array_diff array_diff() took 0.958 seconds and returned 5000 entries
Output for 5.4.24
Starting array_diff array_diff() took 1.541 seconds and returned 5000 entries
Output for 5.4.23
Starting array_diff array_diff() took 1.000 seconds and returned 5000 entries
Output for 5.4.22
Starting array_diff array_diff() took 1.306 seconds and returned 5000 entries
Output for 5.4.21
Starting array_diff array_diff() took 0.932 seconds and returned 5000 entries
Output for 5.4.7, 5.4.20
Starting array_diff array_diff() took 0.667 seconds and returned 5000 entries
Output for 5.4.19
Starting array_diff array_diff() took 0.679 seconds and returned 5000 entries
Output for 5.4.18
Starting array_diff array_diff() took 0.684 seconds and returned 5000 entries
Output for 5.4.17
Starting array_diff array_diff() took 0.676 seconds and returned 5000 entries
Output for 5.4.16
Starting array_diff array_diff() took 0.693 seconds and returned 5000 entries
Output for 5.4.14
Starting array_diff array_diff() took 0.627 seconds and returned 5000 entries
Output for 5.4.13
Starting array_diff array_diff() took 0.642 seconds and returned 5000 entries
Output for 5.4.11
Starting array_diff array_diff() took 0.757 seconds and returned 5000 entries
Output for 5.4.8 - 5.4.10
Starting array_diff array_diff() took 0.689 seconds and returned 5000 entries
Output for 5.3.12, 5.4.3
Starting array_diff array_diff() took 0.647 seconds and returned 5000 entries
Output for 5.4.1
Starting array_diff array_diff() took 0.672 seconds and returned 5000 entries
Output for 5.3.29 - 5.4.0
Starting array_diff array_diff() took 0.652 seconds and returned 5000 entries
Output for 5.3.28
Starting array_diff array_diff() took 0.759 seconds and returned 5000 entries
Output for 5.3.27
Starting array_diff array_diff() took 0.728 seconds and returned 5000 entries
Output for 5.3.26
Starting array_diff array_diff() took 0.826 seconds and returned 5000 entries
Output for 5.3.25
Starting array_diff array_diff() took 0.668 seconds and returned 5000 entries
Output for 5.3.24
Starting array_diff array_diff() took 0.680 seconds and returned 5000 entries
Output for 5.3.23
Starting array_diff array_diff() took 0.706 seconds and returned 5000 entries
Output for 5.3.22
Starting array_diff array_diff() took 0.707 seconds and returned 5000 entries
Output for 5.3.21
Starting array_diff array_diff() took 0.695 seconds and returned 5000 entries
Output for 5.3.20
Starting array_diff array_diff() took 0.737 seconds and returned 5000 entries
Output for 5.3.19
Starting array_diff array_diff() took 1.065 seconds and returned 5000 entries
Output for 5.3.18
Starting array_diff array_diff() took 0.946 seconds and returned 5000 entries
Output for 5.3.17
Starting array_diff array_diff() took 0.694 seconds and returned 5000 entries
Output for 5.3.15
Starting array_diff array_diff() took 0.665 seconds and returned 5000 entries
Output for 5.3.13
Starting array_diff array_diff() took 0.677 seconds and returned 5000 entries
Output for 5.3.11
Starting array_diff array_diff() took 0.643 seconds and returned 5000 entries
Output for 5.3.10
Starting array_diff array_diff() took 0.610 seconds and returned 5000 entries
Output for 5.3.9
Starting array_diff array_diff() took 0.654 seconds and returned 5000 entries