3v4l.org

run code in 300+ PHP versions simultaneously
<?php $configArray = array( 'nominal' => array( 'before' => array( 0 => 'subtotal', ), 'after' => array(), '_code' => 'nominal', ), 'subtotal' => array( 'after' => array( 0 => 'nominal', ), 'before' => array( 0 => 'grand_total', ), '_code' => 'subtotal', ), 'shipping' => array( 'after' => array( 0 => 'subtotal', 1 => 'freeshipping', 2 => 'tax_subtotal', ), 'before' => array( 0 => 'grand_total', ), '_code' => 'shipping', ), 'grand_total' => array( 'after' => array( 0 => 'subtotal', ), 'before' => array(), '_code' => 'grand_total', ), 'msrp' => array( 'before' => array(), 'after' => array(), '_code' => 'msrp', ), 'freeshipping' => array( 'after' => array( 0 => 'subtotal', ), 'before' => array( 0 => 'tax_subtotal', 1 => 'shipping', ), '_code' => 'freeshipping', ), 'discount' => array( 'after' => array( 0 => 'subtotal', 1 => 'shipping', ), 'before' => array( 0 => 'grand_total', ), '_code' => 'discount', ), 'tax_subtotal' => array( 'after' => array( 0 => 'freeshipping', ), 'before' => array( 0 => 'tax', 1 => 'discount', ), '_code' => 'tax_subtotal', ), 'tax_shipping' => array( 'after' => array( 0 => 'shipping', 1 => 'tax_subtotal', ), 'before' => array( 0 => 'tax', 1 => 'discount', ), '_code' => 'tax_shipping', ), 'tax' => array( 'after' => array( 0 => 'subtotal', 1 => 'shipping', 2 => 'discount', ), 'before' => array( 0 => 'grand_total', ), '_code' => 'tax', ), 'vaimo_klarna_fee' => array( 'after' => array( 0 => 'subtotal', 1 => 'discount', ), 'before' => array( 0 => 'shipping', 1 => 'tax', 2 => 'grand_total', ), 'renderer' => 'klarna/checkout_fee', '_code' => 'vaimo_klarna_fee', ), ); function compareTotals($a, $b) { $aCode = $a['_code']; $bCode = $b['_code']; if (in_array($aCode, $b['after']) || in_array($bCode, $a['before'])) { $res = -1; } elseif (in_array($bCode, $a['after']) || in_array($aCode, $b['before'])) { $res = 1; } else { $res = 0; } return $res; } 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.0120.00916.75
8.3.50.0090.00921.93
8.3.40.0150.00018.71
8.3.30.0090.00619.08
8.3.20.0070.00020.25
8.3.10.0030.00620.61
8.3.00.0080.00019.38
8.2.180.0090.00616.50
8.2.170.0090.00922.96
8.2.160.0110.00720.52
8.2.150.0090.00924.18
8.2.140.0040.00424.66
8.2.130.0070.00026.16
8.2.120.0040.00421.01
8.2.110.0000.01019.12
8.2.100.0030.01017.91
8.2.90.0100.00019.21
8.2.80.0000.00817.97
8.2.70.0030.00517.63
8.2.60.0060.00317.93
8.2.50.0050.00318.10
8.2.40.0000.00818.34
8.2.30.0060.00619.36
8.2.20.0000.00817.79
8.2.10.0000.00718.11
8.2.00.0020.00517.74
8.1.280.0130.00725.92
8.1.270.0040.00423.81
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0080.00323.92
8.1.230.0040.00720.90
8.1.220.0000.00817.79
8.1.210.0080.00319.10
8.1.200.0000.01017.38
8.1.190.0000.00817.35
8.1.180.0050.00318.10
8.1.170.0060.00318.53
8.1.160.0000.00821.97
8.1.150.0030.00618.96
8.1.140.0080.00017.37
8.1.130.0000.00717.86
8.1.120.0000.00817.55
8.1.110.0040.00417.43
8.1.100.0000.00717.54
8.1.90.0040.00417.51
8.1.80.0000.00717.49
8.1.70.0000.00717.36
8.1.60.0000.00917.52
8.1.50.0030.00517.64
8.1.40.0050.00317.48
8.1.30.0080.00017.59
8.1.20.0000.00817.72
8.1.10.0000.00817.56
8.1.00.0060.00317.60
8.0.300.0000.00920.10
8.0.290.0040.00416.88
8.0.280.0040.00418.51
8.0.270.0080.00017.19
8.0.260.0000.00717.22
8.0.250.0030.00317.00
8.0.240.0030.00317.00
8.0.230.0000.00817.09
8.0.220.0000.00716.91
8.0.210.0040.00416.97
8.0.200.0030.00617.01
8.0.190.0040.00416.98
8.0.180.0040.00416.98
8.0.170.0040.00416.94
8.0.160.0070.00016.99
8.0.150.0030.00616.92
8.0.140.0040.00416.95
8.0.130.0000.00613.33
8.0.120.0050.00316.91
8.0.110.0080.00016.86
8.0.100.0000.00716.75
8.0.90.0080.00016.82
8.0.80.0130.00616.85
8.0.70.0000.00816.97
8.0.60.0040.00417.01
8.0.50.0040.00416.90
8.0.30.0150.00616.88
8.0.20.0060.01217.40
8.0.10.0040.00416.93
8.0.00.0060.01216.79
7.4.330.0020.00215.00
7.4.320.0030.00616.57
7.4.300.0030.00316.64
7.4.290.0040.00416.62
7.4.280.0040.00416.55
7.4.270.0080.00016.57
7.4.260.0040.00416.66
7.4.250.0040.00416.59
7.4.240.0000.00716.59
7.4.230.0030.00316.62
7.4.220.0130.00616.57
7.4.210.0120.00616.61
7.4.200.0000.00716.66
7.4.160.0040.01216.64
7.4.150.0070.01117.40
7.4.140.0110.01017.86
7.4.130.0110.00616.59
7.4.120.0110.00616.44
7.4.110.0040.01216.55
7.4.100.0140.00716.56
7.4.90.0120.00616.57
7.4.80.0100.00719.39
7.4.70.0070.01316.66
7.4.60.0060.01216.62
7.4.50.0000.00816.20
7.4.40.0080.00816.64
7.4.30.0080.00816.62
7.4.00.0090.00614.90
7.3.330.0040.00213.43
7.3.320.0000.00613.28
7.3.310.0070.00016.54
7.3.300.0000.00716.28
7.3.290.0060.00916.36
7.3.280.0100.01016.37
7.3.270.0040.01417.40
7.3.260.0130.00316.39
7.3.250.0110.00716.39
7.3.240.0090.00916.66
7.3.230.0060.01016.68
7.3.210.0070.01016.48
7.3.200.0100.01419.39
7.3.190.0120.00616.45
7.3.180.0070.00916.71
7.3.170.0160.00616.55
7.3.160.0090.00916.53
7.3.120.0150.00014.90
7.3.110.0060.01015.05
7.3.100.0060.01214.87
7.3.90.0070.01114.80
7.3.80.0070.00714.87
7.3.70.0030.01014.89
7.3.60.0030.01014.93
7.3.50.0070.00714.83
7.3.40.0080.00314.73
7.3.30.0000.01614.90
7.3.20.0040.01516.52
7.3.10.0070.00316.76
7.3.00.0040.00716.66
7.2.330.0070.01116.63
7.2.320.0070.01016.87
7.2.310.0120.00616.79
7.2.300.0090.00916.73
7.2.290.0060.01216.55
7.2.250.0070.01015.20
7.2.240.0030.01715.02
7.2.230.0120.00615.02
7.2.220.0070.00715.06
7.2.210.0040.01114.71
7.2.200.0100.00714.93
7.2.190.0040.00714.95
7.2.180.0040.01115.18
7.2.170.0080.00415.05
7.2.60.0080.00816.82
7.2.00.0060.00619.19
7.1.330.0040.01115.69
7.1.320.0030.00915.45
7.1.310.0000.01515.82
7.1.300.0000.00916.00
7.1.290.0060.01015.60
7.1.280.0040.00815.85
7.1.270.0000.01215.86
7.1.260.0060.00615.83
7.1.200.0030.00315.77
7.1.100.0030.00618.30
7.1.70.0030.00517.25
7.1.60.0070.01819.61
7.1.50.0090.01316.92
7.1.00.0000.07722.30
7.0.200.0390.00714.45
7.0.140.0030.07022.00
7.0.60.0130.08320.09
7.0.50.0100.08718.00
7.0.40.0030.04320.11
7.0.30.0230.07320.26
7.0.20.0300.06320.10
7.0.10.0200.08320.06
7.0.00.0030.04720.05
5.6.280.0070.07321.04
5.6.210.0170.07720.66
5.6.200.0130.07318.27
5.6.190.0170.06720.48
5.6.180.0600.04020.57
5.6.170.0230.04020.47
5.6.160.0130.08720.54
5.6.150.0070.08718.20
5.6.140.0070.08318.18
5.6.130.0130.06318.21
5.6.120.0070.04021.04
5.6.110.0170.08321.03
5.6.100.0130.05321.15
5.6.90.0070.07321.06
5.6.80.0030.04020.55
5.6.70.3770.04720.54
5.5.350.0170.09020.53
5.5.340.0100.07717.96
5.5.330.0030.05020.27
5.5.320.0400.07720.51
5.5.310.0200.03720.51
5.5.300.0130.07718.00
5.5.290.0100.06317.96
5.5.280.0130.08720.84
5.5.270.0070.04021.01
5.5.260.0170.05320.69
5.5.250.0100.07320.51
5.5.240.4400.03320.11
5.4.450.0330.04319.20
5.4.440.0070.05719.57
5.4.430.0530.04719.63
5.4.420.0270.04319.54
5.4.410.0330.04019.34
5.4.400.0500.04018.84
5.4.390.0430.04019.22
5.4.380.0270.05718.79
5.4.370.0370.06718.80
5.4.360.0330.05018.80
5.4.350.0200.06018.84
5.4.340.0430.06718.64
5.4.320.0160.03612.56
5.4.310.0110.04412.55
5.4.300.0090.04012.56
5.4.290.0100.05412.56
5.4.280.0080.03912.45
5.4.270.0080.04112.46
5.4.260.0170.03212.45
5.4.250.0120.03812.45
5.4.240.0080.04012.45
5.4.230.0080.04812.45
5.4.220.0110.03712.45
5.4.210.0140.03212.45
5.4.200.0130.03612.45
5.4.190.0120.03512.44
5.4.180.0090.03812.45
5.4.170.0100.04512.45
5.4.160.0120.04412.44
5.4.150.0110.03812.45
5.4.140.0080.04012.13
5.4.130.0120.03412.12
5.4.120.0120.03512.07
5.4.110.0100.04012.07
5.4.100.0120.03512.07
5.4.90.0120.03612.07
5.4.80.0120.03912.06
5.4.70.0110.03412.06
5.4.60.0130.03612.06
5.4.50.0100.03812.07
5.4.40.0100.03612.05
5.4.30.0080.04712.05
5.4.20.0160.04912.05
5.4.10.0120.03812.05
5.4.00.0110.04111.54
5.3.290.0070.04412.80
5.3.280.0090.04012.73
5.3.270.0090.04112.74
5.3.260.0120.05412.74
5.3.250.0090.04512.74
5.3.240.0110.04512.74
5.3.230.0120.03712.73
5.3.220.0100.03912.70
5.3.210.0120.03812.70
5.3.200.0120.03712.70
5.3.190.0110.03812.70
5.3.180.0150.03412.70
5.3.170.0060.04312.70
5.3.160.0110.03512.70
5.3.150.0110.03912.70
5.3.140.0120.03712.69
5.3.130.0080.04412.69
5.3.120.0120.03912.69
5.3.110.0130.04012.68
5.3.100.0110.03912.17
5.3.90.0140.03412.16
5.3.80.0110.03712.15
5.3.70.0120.03812.15
5.3.60.0080.04012.13
5.3.50.0130.03612.08
5.3.40.0110.03712.08
5.3.30.0120.03612.04
5.3.20.0140.03511.82
5.3.10.0110.03911.79
5.3.00.0110.03811.77
5.2.170.0130.0329.28
5.2.160.0100.0339.27
5.2.150.0090.0359.28
5.2.140.0120.0369.27
5.2.130.0110.0289.23
5.2.120.0090.0299.23
5.2.110.0050.0349.24
5.2.100.0090.0289.23
5.2.90.0090.0319.23
5.2.80.0090.0339.23
5.2.70.0140.0349.23
5.2.60.0090.0379.18
5.2.50.0070.0329.15
5.2.40.0040.0359.13
5.2.30.0090.0309.11
5.2.20.0070.0319.10
5.2.10.0100.0289.00
5.2.00.0110.0288.87
5.1.60.0050.0288.15
5.1.50.0060.0328.15
5.1.40.0070.0268.13
5.1.30.0050.0298.48
5.1.20.0110.0248.50
5.1.10.0090.0258.22
5.1.00.0080.0288.23
5.0.50.0070.0236.71
5.0.40.0070.0216.57
5.0.30.0080.0326.38
5.0.20.0050.0236.35
5.0.10.0090.0196.33
5.0.00.0090.0316.34
4.4.90.0040.0164.77
4.4.80.0070.0164.76
4.4.70.0050.0184.75
4.4.60.0130.0194.75
4.4.50.0110.0144.77
4.4.40.0080.0274.72
4.4.30.0100.0154.76
4.4.20.0090.0174.84
4.4.10.0080.0194.85
4.4.00.0150.0284.76
4.3.110.0080.0194.67
4.3.100.0030.0184.66
4.3.90.0060.0144.64
4.3.80.0060.0284.64
4.3.70.0080.0154.63
4.3.60.0110.0124.63
4.3.50.0080.0164.63
4.3.40.0050.0284.58
4.3.30.0090.0153.39
4.3.20.0060.0183.38
4.3.10.0070.0163.32
4.3.00.0070.01713.95

preferences:
45.21 ms | 401 KiB | 5 Q