3v4l.org

run code in 300+ PHP versions simultaneously
<?php $pivot = []; $n = 0; for ($i = 1; $i <= 100; $i++) { $pivot[$i] = []; } for($i = 1; $i <= 100; $n++) { $user = &$pivot[rand($i, 100)]; $rand = rand(0, 100); $random = $rand != $user ? $rand : $rand + 1; while(array_key_exists($random, $user)) { $random++; } $user[] = $random; if($n == 100) { $i++; $n = 0; } } foreach($pivot as $key => $piv) { echo "INSERT INTO `following_pivot` (`uid`, `fid`) VALUES "; foreach($piv as $pi) { echo "(", $key, ", ", $pi, ")"; if($pi !== end($piv) { 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)
5.4.320.0060.04412.51
5.4.310.0050.04212.50
5.4.300.0060.03912.51
5.4.290.0060.04212.50
5.4.280.0090.03912.40
5.4.270.0050.03612.40
5.4.260.0070.04312.40
5.4.250.0080.04012.40
5.4.240.0100.03512.40
5.4.230.0100.04312.39
5.4.220.0110.04212.39
5.4.210.0090.03812.39
5.4.200.0030.04012.39
5.4.190.0080.03812.39
5.4.180.0120.03712.39
5.4.170.0070.04012.40
5.4.160.0090.04112.39
5.4.150.0090.03912.39
5.4.140.0080.05312.08
5.4.130.0060.03912.06
5.4.120.0010.03912.02
5.4.110.0070.04212.02
5.4.100.0070.03812.02
5.4.90.0050.04512.02
5.4.80.0070.04012.02
5.4.70.0050.04412.02
5.4.60.0050.04112.02
5.4.50.0060.03812.02
5.4.40.0050.04112.01
5.4.30.0040.04112.00
5.4.20.0050.04712.00
5.4.10.0070.04212.00
5.4.00.0080.03411.50
5.3.290.0080.04112.80
5.3.280.0080.03712.70
5.3.270.0070.04912.73
5.3.260.0100.03412.72
5.3.250.0090.03812.72
5.3.240.0110.04112.72
5.3.230.0080.04812.71
5.3.220.0040.04912.68
5.3.210.0060.04012.68
5.3.200.0090.03312.68
5.3.190.0070.03912.68
5.3.180.0100.04412.67
5.3.170.0100.04012.67
5.3.160.0100.03512.67
5.3.150.0080.04512.68
5.3.140.0120.03312.66
5.3.130.0060.05012.66
5.3.120.0080.03812.66
5.3.110.0060.04812.66
5.3.100.0050.04812.12
5.3.90.0080.04012.09
5.3.80.0070.04612.07
5.3.70.0090.03912.07
5.3.60.0040.04212.06
5.3.50.0070.04412.00
5.3.40.0090.04612.00
5.3.30.0070.03411.95
5.3.20.0110.04211.72
5.3.10.0070.04311.70
5.3.00.0040.04111.68
5.2.170.0020.0339.18
5.2.160.0050.0299.18
5.2.150.0040.0319.18
5.2.140.0040.0329.17
5.2.130.0050.0299.14
5.2.120.0050.0329.14
5.2.110.0070.0359.15
5.2.100.0080.0299.14
5.2.90.0060.0369.14
5.2.80.0050.0409.14
5.2.70.0050.0339.14
5.2.60.0090.0269.09
5.2.50.0050.0299.05
5.2.40.0080.0299.03
5.2.30.0050.0399.01
5.2.20.0070.0359.01
5.2.10.0110.0268.93
5.2.00.0030.0398.79
5.1.60.0060.0308.06
5.1.50.0010.0288.06
5.1.40.0020.0268.05
5.1.30.0060.0308.40
5.1.20.0050.0298.42
5.1.10.0060.0248.14
5.1.00.0070.0238.14
5.0.50.0040.0216.63
5.0.40.0030.0216.48
5.0.30.0030.0326.29
5.0.20.0030.0216.26
5.0.10.0050.0196.24
5.0.00.0020.0356.23
4.4.90.0030.0164.77
4.4.80.0040.0214.76
4.4.70.0030.0184.75
4.4.60.0030.0184.75
4.4.50.0040.0144.77
4.4.40.0040.0274.71
4.4.30.0060.0154.76
4.4.20.0100.0124.85
4.4.10.0050.0174.85
4.4.00.0010.0344.76
4.3.110.0030.0214.67
4.3.100.0040.0174.67
4.3.90.0040.0164.63
4.3.80.0040.0294.59
4.3.70.0020.0154.63
4.3.60.0020.0214.62
4.3.50.0020.0224.63
4.3.40.0030.0274.54
4.3.30.0010.0233.29
4.3.20.0040.0143.26
4.3.10.0060.0173.22
4.3.00.0030.01718.15

preferences:
144.36 ms | 939 KiB | 8 Q