3v4l.org

run code in 300+ PHP versions simultaneously
<?php $pivot = []; $n = 0; for ($i = 1; $i <= 20; $i++) { $pivot[$i] = []; } for($i = 1; $i <= 20; $n++) { $user = &$pivot[$i]; $rand = rand(0, 20); while(in_array($rand, $user) || $rand == $i) { $rand++; } $user[] = $rand; if($n == 10) { $i++; $n = 0; } } natsort($pivot); /*echo "INSERT INTO `following_pivot` (`uid`, `fid`) VALUES "; foreach($pivot as $key => $piv) { foreach($piv as $pi) { echo "(", $key, ",", $pi, ")"; if($pi !== end($piv) && $piv !== end($pivot)) { echo ","; } else { echo "here!!"; } } echo ","; } echo ";"; */print_r($pivot);

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
7.2.00.0100.00619.32
7.1.70.0040.00417.13
7.1.60.0140.01119.46
7.1.50.0140.01016.83
7.1.00.0000.08022.36
7.0.200.0090.00316.57
7.0.140.0030.07722.08
7.0.60.0030.08319.87
7.0.50.0130.07717.85
7.0.40.0000.05019.96
7.0.30.0130.04720.21
7.0.20.0330.06320.07
7.0.10.0400.05020.07
7.0.00.0100.09020.21
5.6.280.0130.07021.03
5.6.210.0000.04320.64
5.6.200.0070.07718.21
5.6.190.0070.09020.60
5.6.180.0130.05320.33
5.6.170.0330.08020.43
5.6.160.0070.08320.57
5.6.150.0100.08018.27
5.6.140.0070.03718.17
5.6.130.0100.05718.17
5.6.120.0100.08021.12
5.6.110.0100.08320.96
5.6.100.0170.08321.04
5.6.90.0030.08721.13
5.6.80.0070.03720.41
5.6.70.0030.06320.39
5.5.350.0070.03020.38
5.5.340.0100.08017.96
5.5.330.0270.05720.13
5.5.320.0300.07720.27
5.5.310.0400.05720.35
5.5.300.0100.06318.07
5.5.290.0030.04317.91
5.5.280.0130.08020.98
5.5.270.0070.08720.96
5.5.260.0100.08020.72
5.5.250.0130.08020.70
5.5.240.0070.04320.16
5.4.450.0330.04319.33
5.4.440.3770.04019.27
5.4.430.0200.05719.56
5.4.420.0230.03719.51
5.4.410.0170.03719.35
5.4.400.0170.04019.17
5.4.390.0130.04718.95
5.4.380.0300.06019.31
5.4.370.0230.03319.13
5.4.360.0430.04319.20
5.4.350.0200.08018.96
5.4.340.0100.06319.15
5.4.320.0110.04312.52
5.4.310.0120.04112.52
5.4.300.0160.04012.52
5.4.290.0080.04312.51
5.4.280.0110.04112.41
5.4.270.0120.03912.41
5.4.260.0180.03412.41
5.4.250.0130.04012.41
5.4.240.0110.04112.41
5.4.230.0130.04012.40
5.4.220.0140.03612.41
5.4.210.0120.03912.40
5.4.200.0120.03812.40
5.4.190.0180.03212.40
5.4.180.0140.03712.40
5.4.170.0130.03612.41
5.4.160.0140.03612.41
5.4.150.0130.04112.40
5.4.140.4370.04716.32
5.4.130.0270.06716.38
5.4.120.0200.03316.30
5.4.110.0270.06716.41
5.4.100.0200.03316.60
5.4.90.0130.03716.38
5.4.80.0030.06716.43
5.4.70.0000.03716.30
5.4.60.0030.07316.49
5.4.50.0070.05316.43
5.4.40.0000.04716.48
5.4.30.0230.06716.53
5.4.20.0200.06316.44
5.4.10.3100.03716.54
5.4.00.3470.03715.77

preferences:
37.75 ms | 401 KiB | 5 Q