3v4l.org

run code in 300+ PHP versions simultaneously
<?php $amount = $qty = $code = $id = range(1, 5000); //dry-run $op = '%s executed in %.8f seconds'; $start = $end = microtime(true); $max = count($id); $data = []; for ($i=0; $i<ceil($max/2); $i++) { $z = $max-($i+1); $data[$i] = [ 'id' => $id[$i], 'code' => $code[$i], 'qty' => $qty[$i], 'amount' => $amount[$i] ]; $data[$z] = [ 'id' => $id[$z], 'code' => $code[$z], 'qty' => $qty[$z], 'amount' => $amount[$z] ]; } //end dry-run $start = microtime(true); $max = count($id); $half = ceil($max/2); $data = []; for ($i=0; $i<$half; $i++) { $z = $max-($i+1); $data[$i] = [ 'id' => $id[$i], 'code' => $code[$i], 'qty' => $qty[$i], 'amount' => $amount[$i] ]; $data[$z] = [ 'id' => $id[$z], 'code' => $code[$z], 'qty' => $qty[$z], 'amount' => $amount[$z] ]; } $end = microtime(true); printf($op, 'for ceil', $end - $start);

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.4.10.0170.01018.32
7.4.00.0150.00718.71
7.3.130.0140.01418.36
7.3.120.0150.01318.57
7.3.110.0130.01318.49
7.3.100.0140.01118.58
7.3.90.0140.01318.58
7.3.80.0090.01718.55
7.3.70.0140.00718.46
7.3.60.0180.00718.20
7.3.50.0150.00818.50
7.3.40.0110.01218.37
7.3.30.0140.01118.53
7.3.20.0120.01218.39
7.3.10.0110.01418.57
7.3.00.0260.00818.46
7.2.260.0090.01418.38
7.2.250.0110.01818.52
7.2.240.0190.00918.39
7.2.230.0190.01218.37
7.2.220.0090.01818.46
7.2.210.0110.01118.12
7.2.200.0090.01418.33
7.2.190.0120.01118.29
7.2.180.0120.01018.49
7.2.170.0110.01818.28
7.2.160.0160.00918.68
7.2.150.0160.01118.61
7.2.140.0140.01618.65
7.2.130.0120.01218.40
7.2.120.0110.01618.58
7.2.110.0140.01318.53
7.2.100.0130.01418.44
7.2.90.0140.01818.45
7.2.80.0100.01318.47
7.2.70.0140.01018.40
7.2.60.0120.01118.42
7.2.50.0150.01118.52
7.2.40.0140.01418.42
7.2.30.0160.01118.43
7.2.20.0150.01318.44
7.2.10.0090.01918.50
7.2.00.0170.01418.58
7.1.330.0200.01217.91
7.1.320.0180.01817.82
7.1.310.0160.01017.57
7.1.300.0260.00617.69
7.1.290.0220.01417.75
7.1.280.0140.01517.67
7.1.270.0250.01317.69
7.1.260.0120.01517.61
7.1.250.0240.01117.61
7.1.240.0180.01517.77
7.1.230.0090.01917.65
7.1.220.0350.02217.51
7.1.210.0350.00717.67
7.1.200.0220.00917.60
7.1.190.0070.02217.56
7.1.180.0230.01317.65
7.1.170.0160.01317.71
7.1.160.0210.01817.73
7.1.150.0210.00917.71
7.1.140.0160.01317.54
7.1.130.0170.01317.50
7.1.120.0110.02317.67
7.1.110.0220.00817.72
7.1.100.0220.00717.69
7.1.90.0220.00717.81
7.1.80.0200.01117.79
7.1.70.0190.01117.43
7.1.60.0160.01217.57
7.1.50.0150.01217.68
7.1.40.0170.01317.67
7.1.30.0200.00717.69
7.1.20.0230.00617.50
7.1.10.0190.01017.58
7.1.00.0180.01317.53
7.0.330.0150.01917.25
7.0.320.0120.01417.43
7.0.310.0140.01417.54
7.0.300.0180.01417.34
7.0.290.0160.01117.28
7.0.280.0230.01517.32
7.0.270.0140.01417.43
7.0.260.0240.01217.50
7.0.250.0250.00917.37
7.0.240.0230.01117.38
7.0.230.0180.01217.39
7.0.220.0130.01817.41
7.0.210.0180.01017.50
7.0.200.0170.01217.37
7.0.190.0130.01317.44
7.0.180.0120.02017.28
7.0.170.0080.01917.49
7.0.160.0140.01417.36
7.0.150.0190.01017.47
7.0.140.0180.00917.37
7.0.130.0290.00617.20
7.0.120.0170.01417.45
7.0.110.0160.01417.50
7.0.100.0180.01117.49
7.0.90.0170.01417.46
7.0.80.0160.01617.33
7.0.70.0210.00917.21
7.0.60.0190.01017.25
7.0.50.0190.01017.36
7.0.40.0130.01617.27
7.0.30.0320.01417.34
7.0.20.0100.02117.26
7.0.10.0100.01616.98
7.0.00.0140.01217.49
5.6.400.0280.01320.06
5.6.390.0220.02620.06
5.6.380.0170.03020.13
5.6.370.0220.01920.00
5.6.360.0210.02520.02
5.6.350.0240.01819.70
5.6.340.0200.02319.72
5.6.330.0200.02019.66
5.6.320.0130.03019.82
5.6.310.0210.02519.88
5.6.300.0220.01919.77
5.6.290.0260.01519.68
5.6.280.0230.02019.65
5.6.270.0170.02419.86
5.6.260.0280.02119.96
5.6.250.0210.02419.94
5.6.240.0120.03320.06
5.6.230.0210.02419.81
5.6.220.0250.01819.64
5.6.210.0160.02919.73
5.6.200.0230.02319.85
5.6.190.0240.02119.88
5.6.180.0170.02319.81
5.6.170.0240.03419.75
5.6.160.0190.02219.41
5.6.150.0140.02519.75
5.6.140.0110.02519.91
5.6.130.0170.01419.57
5.6.120.0100.02819.77
5.6.110.0220.01119.86
5.6.100.0160.02019.47
5.6.90.0240.01219.24
5.6.80.0190.01919.46
5.6.70.0230.01219.76
5.6.60.0220.01319.71
5.6.50.0040.03019.71
5.6.40.0240.02519.62
5.6.30.0170.02019.85
5.6.20.0150.01919.86
5.6.10.0200.01319.67
5.6.00.0180.02119.88
5.5.380.0240.02419.96
5.5.370.0190.02519.74
5.5.360.0160.02619.68
5.5.350.0120.03020.00
5.5.340.0290.01619.93
5.5.330.0180.02819.99
5.5.320.0120.04019.90
5.5.310.0310.02019.59
5.5.300.0190.01419.81
5.5.290.0160.01619.88
5.5.280.0260.01919.89
5.5.270.0160.01619.70
5.5.260.0130.02219.80
5.5.250.0060.04619.58
5.5.240.0170.01719.70
5.5.230.0210.01419.74
5.5.220.0150.02119.70
5.5.210.0260.02319.55
5.5.200.0280.02219.72
5.5.190.0140.02619.75
5.5.180.0030.03419.57
5.5.170.0180.02619.64
5.5.160.0140.02619.71
5.5.150.0180.02519.55
5.5.140.0170.03419.90
5.5.130.0170.03319.88
5.5.120.0150.02719.58
5.5.110.0160.02319.84
5.5.100.0200.02019.50
5.5.90.0110.02719.70
5.5.80.0230.01519.57
5.5.70.0200.03019.72
5.5.60.0190.02519.52
5.5.50.0260.01519.71
5.5.40.0190.02219.70
5.5.30.0170.02919.38
5.5.20.0140.03619.87
5.5.10.0160.03319.58
5.5.00.0080.03519.59
5.4.450.0030.02616.56
5.4.440.0180.03016.52
5.4.430.0060.02316.65
5.4.420.0210.01216.38
5.4.410.0140.01716.39
5.4.400.0120.01816.41
5.4.390.0090.02416.40
5.4.380.0110.01916.61
5.4.370.0120.02016.39
5.4.360.0100.02716.52
5.4.350.0160.02016.45
5.4.340.0180.01216.46
5.4.330.0160.01416.67
5.4.320.0110.02516.19
5.4.310.0170.02116.10
5.4.300.0140.03116.20
5.4.290.0060.03216.41
5.4.280.0210.01416.48
5.4.270.0140.02016.25
5.4.260.0160.02216.24
5.4.250.0030.03516.40
5.4.240.0140.02016.51
5.4.230.0160.02016.21
5.4.220.0190.01616.36
5.4.210.0200.01716.39
5.4.200.0240.02116.73
5.4.190.0090.02316.23
5.4.180.0150.03316.50
5.4.170.0230.02416.21
5.4.160.0240.01216.25
5.4.150.0290.00616.37
5.4.140.0100.02616.46
5.4.130.0070.02616.41
5.4.120.0180.01416.32
5.4.110.0140.01816.62
5.4.100.0230.01716.21
5.4.90.0220.02916.48
5.4.80.0140.02116.38
5.4.70.0140.02116.56
5.4.60.0180.02116.54
5.4.50.0110.03916.54
5.4.40.0300.01516.48
5.4.30.0170.02016.22
5.4.20.0200.01716.49
5.4.10.0140.02316.55
5.4.00.0170.02316.26
5.3.290.0130.00612.69
5.3.280.0100.00712.65
5.3.270.0150.01212.71
5.3.260.0090.01712.81
5.3.250.0160.00412.71
5.3.240.0080.01112.49
5.3.230.0190.00012.66
5.3.220.0180.00312.64
5.3.210.0130.00612.88
5.3.200.0100.00812.57
5.3.190.0140.00712.67
5.3.180.0200.00012.91
5.3.170.0140.00812.86
5.3.160.0180.00612.91
5.3.150.0120.00912.91
5.3.140.0130.00812.77
5.3.130.0100.01012.84
5.3.120.0000.01912.77
5.3.110.0130.00813.00
5.3.100.0120.00612.84
5.3.90.0080.01213.06
5.3.80.0090.01312.70
5.3.70.0110.00712.94
5.3.60.0140.01012.76
5.3.50.0160.00912.81
5.3.40.0120.00912.68
5.3.30.0150.00312.63
5.3.20.0080.01212.54
5.3.10.0170.00612.49
5.3.00.0000.01812.49
5.2.170.0140.00611.83
5.2.160.0130.00311.83
5.2.150.0040.01211.83
5.2.140.0090.00611.83
5.2.130.0060.01011.83
5.2.120.0110.00511.83
5.2.110.0140.00411.83
5.2.100.0070.01011.83
5.2.90.0140.00611.83
5.2.80.0090.01411.83
5.2.70.0100.00711.83
5.2.60.0160.00311.83
5.2.50.0160.00311.83
5.2.40.0100.01011.91
5.2.30.0080.00811.83
5.2.20.0130.00711.83
5.2.10.0080.00911.83
5.2.00.0120.00811.83
5.1.60.0130.00511.83
5.1.50.0050.00811.83
5.1.40.0090.00611.83
5.1.30.0120.00311.83
5.1.20.0060.01011.83
5.1.10.0000.01411.83
5.1.00.0070.00711.83
5.0.50.0030.00911.83
5.0.40.0090.00311.83
5.0.30.0060.00911.83
5.0.20.0080.00411.83
5.0.10.0080.00311.83
5.0.00.0030.00911.83
4.4.90.0050.00511.83
4.4.80.0080.00311.83
4.4.70.0100.00011.83
4.4.60.0070.00211.83
4.4.50.0080.00311.83
4.4.40.0040.00411.83
4.4.30.0040.00411.83
4.4.20.0080.00011.83
4.4.10.0080.00011.83
4.4.00.0020.00511.83
4.3.110.0000.00711.83
4.3.100.0080.00311.83
4.3.90.0000.00711.83
4.3.80.0030.00411.83
4.3.70.0030.00411.83
4.3.60.0060.00311.83
4.3.50.0080.00011.83
4.3.40.0040.00411.83
4.3.30.0060.00011.83
4.3.20.0030.00311.83
4.3.10.0000.00711.83
4.3.00.0000.00611.83

preferences:
39.38 ms | 403 KiB | 5 Q