3v4l.org

run code in 300+ PHP versions simultaneously
<?php $configArray = array( 'grand_total' => array( 'after' => array( 0 => 'subtotal', ), 'before' => array(), '_code' => 'grand_total', ), 'discount' => array( 'after' => array( 0 => 'subtotal', 1 => 'shipping', ), 'before' => array( 0 => 'grand_total', ), '_code' => 'discount', ), ); reset($configArray); $element = current($configArray); foreach ($configArray as $code => $data) { foreach ($data['before'] as $beforeCode) { if (!isset($configArray[$beforeCode])) { continue; } $configArray[$code]['before'] = array_unique( array_merge( $configArray[$code]['before'], $configArray[$beforeCode]['before'] ) ); $configArray[$beforeCode]['after'] = array_merge( $configArray[$beforeCode]['after'], array($code), $data['after'] ); $configArray[$beforeCode]['after'] = array_unique($configArray[$beforeCode]['after']); } foreach ($data['after'] as $afterCode) { if (!isset($configArray[$afterCode])) { continue; } $configArray[$code]['after'] = array_unique( array_merge( $configArray[$code]['after'], $configArray[$afterCode]['after'] ) ); $configArray[$afterCode]['before'] = array_merge( $configArray[$afterCode]['before'], array($code), $data['before'] ); $configArray[$afterCode]['before'] = array_unique($configArray[$afterCode]['before']); } } uasort($configArray, 'compareTotals'); print_r($configArray);

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)
8.3.60.0150.00618.53
8.3.50.0110.01122.00
8.3.40.0100.00718.79
8.3.30.0110.00319.17
8.3.20.0070.00020.19
8.3.10.0040.00420.52
8.3.00.0040.00419.51
8.2.180.0070.00716.88
8.2.170.0140.00422.96
8.2.160.0030.01120.34
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0080.00021.16
8.2.110.0090.00020.58
8.2.100.0040.00818.04
8.2.90.0050.00318.22
8.2.80.0050.00317.97
8.2.70.0040.00417.63
8.2.60.0080.00018.16
8.2.50.0000.00818.07
8.2.40.0040.00418.16
8.2.30.0060.00619.51
8.2.20.0040.00417.86
8.2.10.0040.00418.22
8.2.00.0080.00017.70
8.1.280.0040.01125.92
8.1.270.0080.00023.92
8.1.260.0000.00726.35
8.1.250.0040.00428.09
8.1.240.0030.00622.06
8.1.230.0110.00020.89
8.1.220.0050.00317.79
8.1.210.0000.00818.89
8.1.200.0060.00317.23
8.1.190.0040.00417.23
8.1.180.0040.00418.10
8.1.170.0030.00518.53
8.1.160.0040.00421.97
8.1.150.0040.00418.97
8.1.140.0070.00017.38
8.1.130.0030.00317.78
8.1.120.0000.00717.38
8.1.110.0040.00417.51
8.1.100.0040.00417.47
8.1.90.0070.00017.48
8.1.80.0000.00817.37
8.1.70.0030.00317.39
8.1.60.0060.00317.52
8.1.50.0030.00617.59
8.1.40.0000.00717.54
8.1.30.0000.00817.48
8.1.20.0000.00717.71
8.1.10.0000.00817.54
8.1.00.0030.00517.55
8.0.300.0070.00019.98
8.0.290.0030.00616.75
8.0.280.0040.00418.46
8.0.270.0000.00717.26
8.0.260.0000.00717.27
8.0.250.0040.00417.05
8.0.240.0030.00317.04
8.0.230.0040.00417.03
8.0.220.0030.00317.02
8.0.210.0070.00016.86
8.0.200.0000.00717.05
8.0.190.0040.00416.94
8.0.180.0050.00316.96
8.0.170.0050.00317.03
8.0.160.0040.00417.04
8.0.150.0000.00716.85
8.0.140.0040.00416.99
8.0.130.0090.00013.36
8.0.120.0040.00417.03
8.0.110.0030.00516.91
8.0.100.0000.00716.84
8.0.90.0040.00417.09
8.0.80.0060.00916.95
8.0.70.0040.00416.87
8.0.60.0000.00817.00
8.0.50.0000.00716.92
8.0.30.0160.00817.17
8.0.20.0120.00717.42
8.0.10.0040.00417.13
8.0.00.0100.00916.88
7.4.330.0050.00015.01
7.4.320.0030.00616.67
7.4.300.0030.00316.63
7.4.290.0000.00616.52
7.4.280.0040.00416.50
7.4.270.0030.00316.52
7.4.260.0070.00016.61
7.4.250.0040.00416.49
7.4.240.0020.00516.60
7.4.230.0040.00416.50
7.4.220.0100.01016.70
7.4.210.0090.01216.39
7.4.200.0000.00716.51
7.4.160.0130.01016.35
7.4.150.0090.00917.40
7.4.140.0120.00517.86
7.4.130.0070.00916.43
7.4.120.0090.00816.63
7.4.110.0070.01016.57
7.4.100.0050.01316.64
7.4.90.0100.00716.43
7.4.80.0140.00319.39
7.4.70.0060.01316.54
7.4.60.0090.01316.34
7.4.50.0000.00816.40
7.4.40.0090.00616.67
7.4.30.0130.00316.70
7.4.00.0100.00715.00
7.3.330.0060.00013.40
7.3.320.0000.00613.22
7.3.310.0000.00716.48
7.3.300.0030.00316.41
7.3.290.0070.00816.39
7.3.280.0100.00716.46
7.3.270.0170.00717.40
7.3.260.0140.00316.42
7.3.250.0090.00916.49
7.3.240.0030.01216.44
7.3.230.0070.01016.42
7.3.210.0140.00316.62
7.3.200.0090.00619.39
7.3.190.0110.00616.39
7.3.180.0090.00616.39
7.3.170.0090.00616.48
7.3.160.0120.00616.75
7.2.330.0100.00716.85
7.2.320.0070.01716.80
7.2.310.0070.01016.77
7.2.300.0050.01116.65
7.2.290.0140.00416.82
7.2.00.0030.01019.61
7.1.100.0040.01218.05
7.1.70.0000.01017.32
7.1.60.0070.01719.61
7.1.50.0030.00716.98
7.1.00.0030.07022.40
7.0.200.0390.00714.74
7.0.140.0000.07721.96
7.0.60.0000.08320.04
7.0.50.0070.07717.90
7.0.40.0070.04020.02
7.0.30.0400.05720.23
7.0.20.0300.03720.05
7.0.10.0070.07720.24
7.0.00.0030.04320.07
5.6.280.0000.07721.13
5.6.210.0000.04320.72
5.6.200.0070.05718.14
5.6.190.0100.07020.40
5.6.180.0370.07020.55
5.6.170.0130.05020.57
5.6.160.0030.08720.48
5.6.150.0070.06318.14
5.6.140.0070.04718.23
5.6.130.0100.07018.17
5.6.120.0100.07720.82
5.6.110.0070.07720.98
5.6.100.0100.08721.02
5.6.90.0170.07320.98
5.6.80.0070.08020.51
5.5.350.0270.07320.46
5.5.340.0000.08318.03
5.5.330.0100.05020.25
5.5.320.0370.04020.31
5.5.310.0100.04720.26
5.5.300.0000.06317.98
5.5.290.0070.07017.96
5.5.280.0070.06320.91
5.5.270.0100.03720.75
5.5.260.0130.07320.77
5.5.250.0100.06320.55
5.5.240.0170.04020.33
5.4.450.0370.04719.32
5.4.440.0330.05019.64
5.4.430.0230.04319.56
5.4.420.0230.04319.45
5.4.410.0370.03319.07
5.4.400.0400.03719.15
5.4.390.0170.04719.09
5.4.380.0330.05018.79
5.4.370.0300.05018.70
5.4.360.0230.04718.48
5.4.350.0200.05318.78
5.4.340.0300.04718.63
5.4.320.0090.03612.50
5.4.310.0080.03612.49
5.4.300.0050.03812.49
5.4.290.0090.03512.49
5.4.280.0090.03312.39
5.4.270.0050.03912.39
5.4.260.0080.03712.39
5.4.250.0070.03812.39
5.4.240.0090.04012.39
5.4.230.0090.04312.38
5.4.220.0100.03512.38
5.4.210.0070.03612.38
5.4.200.0040.03912.38
5.4.190.0070.03612.38
5.4.180.0100.03212.38
5.4.170.0070.03612.39
5.4.160.0050.03812.38
5.4.150.0080.03712.38
5.4.140.0050.03812.06
5.4.130.0060.03612.05
5.4.120.0090.03212.01
5.4.110.0100.03112.01
5.4.100.0040.03812.01
5.4.90.0060.03812.01
5.4.80.0110.04212.01
5.4.70.0050.03712.00
5.4.60.0110.03012.00
5.4.50.0080.03312.00
5.4.40.0090.03211.99
5.4.30.0030.03811.99
5.4.20.0070.03511.99
5.4.10.0110.03311.99
5.4.00.0040.04111.48
5.3.290.0090.03712.80
5.3.280.0080.03612.71
5.3.270.0080.03712.73
5.3.260.0080.04012.72
5.3.250.0060.03812.72
5.3.240.0080.03912.72
5.3.230.0100.03412.71
5.3.220.0060.03812.68
5.3.210.0070.04112.68
5.3.200.0060.04312.68
5.3.190.0070.03712.68
5.3.180.0060.03712.67
5.3.170.0050.03812.67
5.3.160.0040.03912.67
5.3.150.0120.03212.67
5.3.140.0080.03912.66
5.3.130.0070.04212.66
5.3.120.0090.03612.66
5.3.110.0060.04112.66
5.3.100.0100.03412.13
5.3.90.0090.03612.11
5.3.80.0060.03812.10
5.3.70.0080.04412.10
5.3.60.0100.04112.08
5.3.50.0060.03612.03
5.3.40.0060.03712.03
5.3.30.0080.03511.99
5.3.20.0080.03411.78
5.3.10.0070.03311.73
5.3.00.0030.03911.72
5.2.170.0040.0329.23
5.2.160.0070.0279.23
5.2.150.0040.0349.23
5.2.140.0060.0349.23
5.2.130.0060.0299.18
5.2.120.0040.0319.19
5.2.110.0070.0289.19
5.2.100.0060.0289.19
5.2.90.0030.0319.18
5.2.80.0070.0289.18
5.2.70.0130.0279.18
5.2.60.0080.0329.13
5.2.50.0070.0329.10
5.2.40.0060.0299.08
5.2.30.0040.0309.06
5.2.20.0060.0289.04
5.2.10.0070.0268.95
5.2.00.0030.0318.82
5.1.60.0070.0228.09
5.1.50.0070.0228.08
5.1.40.0050.0248.06
5.1.30.0030.0278.41
5.1.20.0030.0288.43
5.1.10.0070.0258.16
5.1.00.0050.0268.16
5.0.50.0090.0186.65
5.0.40.0050.0186.50
5.0.30.0060.0296.32
5.0.20.0060.0176.29
5.0.10.0040.0206.26
5.0.00.0030.0316.27
4.4.90.0070.0124.78
4.4.80.0050.0144.76
4.4.70.0020.0164.75
4.4.60.0040.0154.75
4.4.50.0010.0184.77
4.4.40.0030.0264.70
4.4.30.0040.0154.76
4.4.20.0050.0144.85
4.4.10.0060.0134.85
4.4.00.0020.0264.76
4.3.110.0010.0184.67
4.3.100.0030.0154.67
4.3.90.0030.0154.64
4.3.80.0060.0224.59
4.3.70.0040.0164.63
4.3.60.0050.0204.63
4.3.50.0030.0194.63
4.3.40.0030.0334.54
4.3.30.0040.0183.31
4.3.20.0030.0183.29
4.3.10.0060.0183.25
4.3.00.0070.02013.95

preferences:
49.76 ms | 401 KiB | 5 Q