3v4l.org

run code in 300+ PHP versions simultaneously
<?php $id = [11,12,13]; $code = ['1234','5678','9012']; $qty = [3,4,5]; $amount = [12.34,23.45,34.56]; //dry-run $op = '%s executed in %.8f seconds'; $start = $end = 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 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.0110.00716.57
7.4.00.0110.01116.67
7.3.130.0030.01316.52
7.3.120.0090.00616.38
7.3.110.0070.01116.64
7.3.100.0030.01016.61
7.3.90.0100.00616.54
7.3.80.0060.01216.64
7.3.70.0060.00916.35
7.3.60.0060.00916.43
7.3.50.0140.00416.47
7.3.40.0080.00816.50
7.3.30.0090.00616.41
7.3.20.0040.01116.41
7.3.10.0130.00316.58
7.3.00.0070.01016.41
7.2.260.0060.01216.50
7.2.250.0070.01016.82
7.2.240.0070.01016.34
7.2.230.0070.00716.77
7.2.220.0060.00916.41
7.2.210.0150.00916.63
7.2.200.0000.01716.75
7.2.190.0070.01016.66
7.2.180.0170.00016.57
7.2.170.0100.00716.61
7.2.160.0080.00816.75
7.2.150.0100.00716.67
7.2.140.0030.01316.66
7.2.130.0120.00416.64
7.2.120.0090.00716.68
7.2.110.0090.01216.93
7.2.100.0090.01216.59
7.2.90.0090.00916.75
7.2.80.0140.00316.68
7.2.70.0110.01116.90
7.2.60.0040.01416.72
7.2.50.0070.01116.66
7.2.40.0070.01116.66
7.2.30.0090.00916.73
7.2.20.0120.00316.79
7.2.10.0070.01116.76
7.2.00.0060.01216.26
7.1.330.0080.01115.67
7.1.320.0230.00015.61
7.1.310.0110.01415.78
7.1.300.0150.00815.57
7.1.290.0130.01015.55
7.1.280.0090.01515.57
7.1.270.0180.00415.63
7.1.260.0140.01115.71
7.1.250.0220.00015.70
7.1.240.0250.00015.61
7.1.230.0170.00815.45
7.1.220.0200.01015.73
7.1.210.0110.01115.43
7.1.200.0170.00315.54
7.1.190.0200.00315.23
7.1.180.0140.00815.54
7.1.170.0220.00615.53
7.1.160.0150.00515.58
7.1.150.0190.00415.55
7.1.140.0140.00715.63
7.1.130.0110.01215.59
7.1.120.0180.00615.62
7.1.110.0220.00315.57
7.1.100.0130.01015.62
7.1.90.0170.00615.46
7.1.80.0130.01315.59
7.1.70.0210.00915.58
7.1.60.0170.01715.75
7.1.50.0140.01415.53
7.1.40.0180.00815.46
7.1.30.0180.01415.64
7.1.20.0180.00615.63
7.1.10.0090.01515.77
7.1.00.0070.02015.55
7.0.330.0330.01015.19
7.0.320.0140.01115.30
7.0.310.0130.00815.26
7.0.300.0210.00415.25
7.0.290.0130.00714.98
7.0.280.0090.01215.05
7.0.270.0150.00915.25
7.0.260.0170.00615.19
7.0.250.0120.01715.20
7.0.240.0150.00915.23
7.0.230.0190.01315.23
7.0.220.0140.01215.38
7.0.210.0390.00615.34
7.0.200.0160.00915.15
7.0.190.0100.01415.20
7.0.180.0110.01115.17
7.0.170.0200.00815.30
7.0.160.0040.01715.42
7.0.150.0060.01215.21
7.0.140.0150.00915.09
7.0.130.0140.00715.34
7.0.120.0100.01515.40
7.0.110.0200.00315.26
7.0.100.0110.00815.18
7.0.90.0160.00815.43
7.0.80.0140.00615.20
7.0.70.0080.01915.12
7.0.60.0080.01115.26
7.0.50.0120.00515.44
7.0.40.0120.01215.30
7.0.30.0240.00615.15
7.0.20.0140.01115.29
7.0.10.0090.01215.31
7.0.00.0190.00315.16
5.6.400.0140.00715.79
5.6.390.0100.01416.02
5.6.380.0190.01015.70
5.6.370.0150.01215.56
5.6.360.0160.00415.63
5.6.350.0110.01115.99
5.6.340.0080.01615.73
5.6.330.0290.00016.14
5.6.320.0150.01216.08
5.6.310.0180.01115.91
5.6.300.0140.01415.86
5.6.290.0110.01116.12
5.6.280.0140.01215.79
5.6.270.0140.01216.16
5.6.260.0200.00915.82
5.6.250.0190.00515.66
5.6.240.0160.00415.98
5.6.230.0080.01516.02
5.6.220.0220.00915.86
5.6.210.0140.00715.88
5.6.200.0120.00815.88
5.6.190.0240.00816.16
5.6.180.0140.01116.08
5.6.170.0090.01515.96
5.6.160.0160.01216.05
5.6.150.0170.00915.97
5.6.140.0150.01116.06
5.6.130.0190.01015.92
5.6.120.0210.00815.99
5.6.110.0120.01816.22
5.6.100.0260.00315.80
5.6.90.0150.01216.19
5.6.80.0090.01816.01
5.6.70.0140.01015.83
5.6.60.0060.01915.91
5.6.50.0170.00615.88
5.6.40.0110.01215.94
5.6.30.0090.01815.82
5.6.20.0150.01216.00
5.6.10.0080.01715.91
5.6.00.0220.00716.02
5.5.380.0150.00615.82
5.5.370.0080.01615.97
5.5.360.0080.02115.95
5.5.350.0130.01315.65
5.5.340.0150.01215.98
5.5.330.0200.01016.01
5.5.320.0180.00515.82
5.5.310.0120.01216.08
5.5.300.0180.01115.97
5.5.290.0230.01116.02
5.5.280.0220.00416.16
5.5.270.0180.01116.01
5.5.260.0260.00416.16
5.5.250.0200.01115.76
5.5.240.0190.01415.87
5.5.230.0210.00815.91
5.5.220.0170.00615.94
5.5.210.0110.01715.98
5.5.200.0090.01515.98
5.5.190.0190.01315.93
5.5.180.0100.01316.14
5.5.170.0170.01615.97
5.5.160.0170.00915.89
5.5.150.0160.01016.02
5.5.140.0200.00816.18
5.5.130.0200.00716.05
5.5.120.0120.01815.95
5.5.110.0240.00516.21
5.5.100.0130.01015.85
5.5.90.0170.00915.76
5.5.80.0090.01216.03
5.5.70.0150.01216.02
5.5.60.0210.00915.75
5.5.50.0070.01715.75
5.5.40.0120.00915.94
5.5.30.0040.01815.79
5.5.20.0130.01316.15
5.5.10.0140.01115.96
5.5.00.0110.01815.85
5.4.450.0090.01312.80
5.4.440.0120.01012.61
5.4.430.0140.00612.68
5.4.420.0090.00912.74
5.4.410.0150.00712.78
5.4.400.0150.00512.57
5.4.390.0080.00812.57
5.4.380.0160.00012.62
5.4.370.0110.01112.39
5.4.360.0100.00712.61
5.4.350.0130.00812.54
5.4.340.0110.00712.62
5.4.330.0180.00312.63
5.4.320.0110.01112.73
5.4.310.0170.00312.67
5.4.300.0110.00912.61
5.4.290.0110.00712.42
5.4.280.0110.01112.45
5.4.270.0160.00012.39
5.4.260.0100.01012.64
5.4.250.0110.00812.48
5.4.240.0070.01112.57
5.4.230.0140.00612.50
5.4.220.0170.00012.57
5.4.210.0070.01012.63
5.4.200.0060.01112.81
5.4.190.0050.01112.80
5.4.180.0140.00712.91
5.4.170.0070.00812.54
5.4.160.0040.01212.72
5.4.150.0080.00812.91
5.4.140.0060.01212.61
5.4.130.0030.01312.65
5.4.120.0180.00012.53
5.4.110.0090.00912.57
5.4.100.0150.00312.55
5.4.90.0090.01112.78
5.4.80.0080.01112.71
5.4.70.0110.00412.64
5.4.60.0100.00612.69
5.4.50.0080.00612.63
5.4.40.0100.00312.71
5.4.30.0140.00312.60
5.4.20.0110.00712.73
5.4.10.0120.00412.70
5.4.00.0170.00012.83
5.3.290.0140.00512.72
5.3.280.0180.00712.58
5.3.270.0080.00812.68
5.3.260.0080.00812.59
5.3.250.0100.00912.55
5.3.240.0140.00812.51
5.3.230.0100.00712.54
5.3.220.0110.00812.64
5.3.210.0030.01712.59
5.3.200.0100.00712.57
5.3.190.0220.00312.79
5.3.180.0090.00812.93
5.3.170.0030.01212.89
5.3.160.0070.00813.05
5.3.150.0070.00712.90
5.3.140.0110.00412.65
5.3.130.0080.00812.71
5.3.120.0120.00812.88
5.3.110.0030.01312.73
5.3.100.0060.00912.74
5.3.90.0070.01013.05
5.3.80.0180.00012.59
5.3.70.0030.01412.67
5.3.60.0030.01612.74
5.3.50.0130.01012.74
5.3.40.0000.01612.61
5.3.30.0100.00712.66
5.3.20.0080.00712.89
5.3.10.0000.01412.55
5.3.00.0080.00812.46
5.2.170.0060.00911.83
5.2.160.0060.01711.83
5.2.150.0100.00311.85
5.2.140.0100.00311.83
5.2.130.0100.00311.83
5.2.120.0030.01211.83
5.2.110.0090.00311.83
5.2.100.0120.00611.83
5.2.90.0080.00711.92
5.2.80.0060.01011.89
5.2.70.0090.00611.83
5.2.60.0030.01011.83
5.2.50.0050.00711.83
5.2.40.0040.00811.83
5.2.30.0030.01311.83
5.2.20.0060.00611.83
5.2.10.0110.00511.83
5.2.00.0070.00711.83
5.1.60.0060.00611.83
5.1.50.0030.00911.83
5.1.40.0090.00611.83
5.1.30.0110.00011.83
5.1.20.0080.00511.83
5.1.10.0080.00811.83
5.1.00.0070.00311.83
5.0.50.0030.00611.83
5.0.40.0070.00411.83
5.0.30.0000.01011.83
5.0.20.0070.00311.83
5.0.10.0060.00311.83
5.0.00.0000.01011.83
4.4.90.0030.00311.83
4.4.80.0030.00311.83
4.4.70.0060.00311.83
4.4.60.0040.00311.83
4.4.50.0020.00411.83
4.4.40.0060.00011.83
4.4.30.0000.00811.83
4.4.20.0000.00711.83
4.4.10.0000.00511.83
4.4.00.0000.00511.83
4.3.110.0030.00311.83
4.3.100.0000.00611.83
4.3.90.0030.00211.83
4.3.80.0030.00311.83
4.3.70.0030.00311.83
4.3.60.0060.00011.83
4.3.50.0060.00011.83
4.3.40.0060.00011.83
4.3.30.0000.00511.83
4.3.20.0030.00311.83
4.3.10.0060.00011.83
4.3.00.0060.00011.83

preferences:
41.74 ms | 403 KiB | 5 Q