3v4l.org

run code in 300+ PHP versions simultaneously
<?php $configArray = array( 'nominal' => array( 'class' => 'sales/quote_address_total_nominal', 'before' => array( 0 => 'subtotal', ), 'renderer' => 'checkout/total_nominal', 'after' => array(), '_code' => 'nominal', ), 'subtotal' => array( 'class' => 'sales/quote_address_total_subtotal', 'after' => array( 0 => 'nominal', ), 'before' => array( 0 => 'grand_total', ), 'renderer' => 'tax/checkout_subtotal', 'admin_renderer' => 'adminhtml/sales_order_create_totals_subtotal', '_code' => 'subtotal', ), 'shipping' => array( 'class' => 'sales/quote_address_total_shipping', 'after' => array( 0 => 'subtotal', 1 => 'freeshipping', 2 => 'tax_subtotal', ), 'before' => array( 0 => 'grand_total', ), 'renderer' => 'tax/checkout_shipping', 'admin_renderer' => 'adminhtml/sales_order_create_totals_shipping', '_code' => 'shipping', ), 'grand_total' => array( 'class' => 'sales/quote_address_total_grand', 'after' => array( 0 => 'subtotal', ), 'renderer' => 'tax/checkout_grandtotal', 'admin_renderer' => 'adminhtml/sales_order_create_totals_grandtotal', 'before' => array(), '_code' => 'grand_total', ), 'msrp' => array( 'class' => 'sales/quote_address_total_msrp', 'before' => array(), 'after' => array(), '_code' => 'msrp', ), 'freeshipping' => array( 'class' => 'salesrule/quote_freeshipping', 'after' => array( 0 => 'subtotal', ), 'before' => array( 0 => 'tax_subtotal', 1 => 'shipping', ), '_code' => 'freeshipping', ), 'discount' => array( 'class' => 'salesrule/quote_discount', 'after' => array( 0 => 'subtotal', 1 => 'shipping', ), 'before' => array( 0 => 'grand_total', ), 'admin_renderer' => 'adminhtml/sales_order_create_totals_discount', 'renderer' => 'amrules/checkout_discount', '_code' => 'discount', ), 'tax_subtotal' => array( 'class' => 'tax/sales_total_quote_subtotal', 'after' => array( 0 => 'freeshipping', ), 'before' => array( 0 => 'tax', 1 => 'discount', ), '_code' => 'tax_subtotal', ), 'tax_shipping' => array( 'class' => 'tax/sales_total_quote_shipping', 'after' => array( 0 => 'shipping', 1 => 'tax_subtotal', ), 'before' => array( 0 => 'tax', 1 => 'discount', ), '_code' => 'tax_shipping', ), 'tax' => array( 'class' => 'tax/sales_total_quote_tax', 'after' => array( 0 => 'subtotal', 1 => 'shipping', 2 => 'discount', ), 'before' => array( 0 => 'grand_total', ), 'renderer' => 'tax/checkout_tax', 'admin_renderer' => 'adminhtml/sales_order_create_totals_tax', '_code' => 'tax', ), 'vaimo_klarna_fee' => array( 'class' => 'klarna/quote_total', 'after' => array( 0 => 'subtotal', 1 => 'discount', ), 'before' => array( 0 => 'shipping', 1 => 'tax', 2 => 'grand_total', ), 'renderer' => 'klarna/checkout_fee', '_code' => 'vaimo_klarna_fee', ), 'vaimo_klarna_fee_tax' => array( 'class' => 'klarna/quote_tax', 'after' => array( 0 => 'subtotal', 1 => 'discount', 2 => 'shipping', 3 => 'tax', ), 'before' => array( 0 => 'grand_total', ), '_code' => 'vaimo_klarna_fee_tax', ), ); 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.0170.00316.88
8.3.50.0120.01122.12
8.3.40.0120.00919.02
8.3.30.0040.01219.23
8.3.20.0040.00420.20
8.3.10.0040.00420.34
8.3.00.0000.00819.38
8.2.180.0000.01518.42
8.2.170.0070.01422.96
8.2.160.0040.01120.35
8.2.150.0000.00824.18
8.2.140.0050.00324.66
8.2.130.0070.00726.16
8.2.120.0060.00319.36
8.2.110.0070.01122.26
8.2.100.0040.00818.03
8.2.90.0030.00619.27
8.2.80.0060.00317.97
8.2.70.0030.00617.63
8.2.60.0040.00418.05
8.2.50.0050.00318.07
8.2.40.0090.00418.17
8.2.30.0000.00719.51
8.2.20.0050.00317.84
8.2.10.0070.00018.07
8.2.00.0000.00717.68
8.1.280.0070.01025.92
8.1.270.0080.00024.02
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0090.00023.84
8.1.230.0080.00419.01
8.1.220.0000.00817.78
8.1.210.0030.00618.77
8.1.200.0000.00917.38
8.1.190.0000.00817.48
8.1.180.0000.00818.10
8.1.170.0040.00418.83
8.1.160.0000.00722.00
8.1.150.0070.00018.86
8.1.140.0030.00617.52
8.1.130.0000.00717.93
8.1.120.0000.00717.49
8.1.110.0040.00417.59
8.1.100.0000.00717.52
8.1.90.0000.00817.49
8.1.80.0030.00517.52
8.1.70.0040.00417.40
8.1.60.0060.00317.71
8.1.50.0080.00017.60
8.1.40.0000.00817.66
8.1.30.0030.00517.54
8.1.20.0020.00517.78
8.1.10.0000.00817.54
8.1.00.0000.00817.46
8.0.300.0000.00918.77
8.0.290.0030.00516.88
8.0.280.0030.00318.50
8.0.270.0050.00217.30
8.0.260.0000.00717.25
8.0.250.0030.00317.09
8.0.240.0040.00417.07
8.0.230.0040.00416.93
8.0.220.0040.00417.02
8.0.210.0030.00317.04
8.0.200.0040.00416.99
8.0.190.0070.00016.98
8.0.180.0040.00417.00
8.0.170.0000.00816.85
8.0.160.0040.00416.95
8.0.150.0000.00816.91
8.0.140.0050.00216.91
8.0.130.0030.00313.42
8.0.120.0000.00816.82
8.0.110.0040.00416.99
8.0.100.0040.00416.83
8.0.90.0060.00317.00
8.0.80.0090.01317.01
8.0.70.0050.00317.00
8.0.60.0000.00716.99
8.0.50.0030.00516.77
8.0.30.0080.01217.21
8.0.20.0140.00517.40
8.0.10.0050.00316.96
8.0.00.0100.01016.86
7.4.330.0020.00215.20
7.4.320.0060.00316.64
7.4.300.0030.00316.66
7.4.290.0040.00416.57
7.4.280.0030.00516.55
7.4.270.0070.00016.57
7.4.260.0030.00316.57
7.4.250.0060.00316.45
7.4.240.0020.00516.62
7.4.230.0040.00416.73
7.4.220.0150.00716.73
7.4.210.0080.00816.64
7.4.200.0040.00416.62
7.4.160.0060.00916.52
7.4.150.0070.01317.40
7.4.140.0120.00617.86
7.4.130.0100.00716.50
7.4.120.0120.00916.61
7.4.110.0090.00916.64
7.4.100.0040.01416.67
7.4.90.0030.01416.58
7.4.80.0040.01819.39
7.4.70.0080.00816.55
7.4.60.0060.01216.49
7.4.50.0000.00816.36
7.4.40.0040.01216.69
7.4.30.0080.00816.57
7.4.00.0150.00015.05
7.3.330.0000.00613.39
7.3.320.0050.00013.41
7.3.310.0050.00316.46
7.3.300.0030.00316.44
7.3.290.0040.01116.45
7.3.280.0090.01016.42
7.3.270.0120.00617.40
7.3.260.0070.01016.68
7.3.250.0100.00716.53
7.3.240.0150.00416.68
7.3.230.0060.01016.68
7.3.210.0030.01516.52
7.3.200.0220.01119.39
7.3.190.0150.00616.45
7.3.180.0090.00716.74
7.3.170.0070.01016.45
7.3.160.0120.00916.51
7.2.330.0140.00316.94
7.2.320.0070.01016.93
7.2.310.0090.00916.53
7.2.300.0060.01016.70
7.2.290.0070.01016.48
7.2.60.0000.01017.10
7.1.200.0170.00515.55
7.1.70.0030.00617.30
7.1.60.0060.01919.61
7.1.50.0030.01017.10
7.1.00.0030.07722.43
7.0.200.0290.00614.86
7.0.140.0070.07321.99
7.0.100.0130.09019.97
7.0.90.0130.04020.02
7.0.80.0230.03319.94
7.0.70.0200.04319.93
7.0.60.0100.04719.97
7.0.50.0100.05320.30
7.0.40.0070.04020.18
7.0.30.0100.04020.04
7.0.20.0070.04720.13
7.0.10.0070.04020.09
7.0.00.0030.04719.99
5.6.280.0170.06720.95
5.6.250.0170.07720.71
5.6.240.0100.04020.64
5.6.230.0030.05320.73
5.6.220.0270.02320.65
5.6.210.0100.03720.51
5.6.200.0030.05321.11
5.6.190.0030.04021.14
5.6.180.0070.03721.08
5.6.170.0100.04020.99
5.6.160.0070.03721.12
5.6.150.0100.03320.99
5.6.140.0030.04021.17
5.6.130.0070.03721.02
5.6.120.0100.04021.05
5.6.110.0030.04020.99
5.6.100.0130.04021.05
5.6.90.0030.03721.05
5.6.80.0070.03720.50
5.6.70.0030.03720.56
5.6.60.0030.06020.44
5.6.50.0030.04320.45
5.6.40.0070.07020.57
5.6.30.0100.08720.45
5.6.20.0100.09320.56
5.6.10.0100.08020.48
5.6.00.0100.04020.40
5.5.380.0200.04020.40
5.5.370.0070.04020.61
5.5.360.0100.03320.59
5.5.350.0130.03720.49
5.5.340.0070.04020.90
5.5.330.0100.04720.87
5.5.320.0130.03720.90
5.5.310.0070.04320.92
5.5.300.0070.03320.84
5.5.290.0100.03320.95
5.5.280.0070.03320.94
5.5.270.0030.03720.93
5.5.260.0000.04020.96
5.5.250.0130.03020.76
5.5.240.0030.03720.34
5.5.230.0100.04020.24
5.5.220.0100.03720.34
5.5.210.0100.03320.25
5.5.200.0000.08320.21
5.5.190.0130.06320.24
5.5.180.0070.06020.16
5.5.160.0100.06020.14
5.5.150.0070.05720.01
5.5.140.0070.05020.30
5.5.130.0100.06020.31
5.5.120.0100.06319.99
5.5.110.0070.03720.27
5.5.100.0170.05320.12
5.5.90.0100.05720.20
5.5.80.0170.07020.20
5.5.70.0130.07320.00
5.5.60.0100.03319.97
5.5.50.0070.05020.09
5.5.40.0100.03720.16
5.5.30.0030.06720.19
5.5.20.0070.07020.17
5.5.10.0100.08320.06
5.5.00.0070.04020.08
5.4.450.0070.03319.22
5.4.440.0070.03319.26
5.4.430.0100.04319.50
5.4.420.0030.03719.55
5.4.410.0200.03019.34
5.4.400.0070.03019.18
5.4.390.0070.03019.03
5.4.380.0200.04719.09
5.4.370.0070.07719.09
5.4.360.0170.07719.03
5.4.350.0070.04018.84
5.4.340.0130.03018.87
5.4.320.0030.04019.16
5.4.310.0170.06719.16
5.4.300.0030.08719.23
5.4.290.0170.07319.05
5.4.280.0070.03719.06
5.4.270.0030.04718.94
5.4.260.0100.03318.90
5.4.250.0100.08018.86
5.4.240.0070.06019.04
5.4.230.0070.04018.87
5.4.220.0100.06719.18
5.4.210.0100.05019.16
5.4.200.0100.04018.89
5.4.190.0130.06718.95
5.4.180.0100.04319.15
5.4.170.0070.05719.09
5.4.160.0070.05719.07
5.4.150.0130.07019.14
5.4.140.0130.05716.52
5.4.130.0070.06316.46
5.4.120.0100.06016.48
5.4.110.0070.04016.45
5.4.100.0100.07316.40
5.4.90.0170.06016.40
5.4.80.0030.04316.34
5.4.70.0100.07716.37
5.4.60.0070.07016.46
5.4.50.0070.04716.46
5.4.40.0070.06716.53
5.4.30.0070.03316.48
5.4.20.0030.06316.41
5.4.10.0030.03716.41
5.4.00.0100.07315.69
5.3.290.0130.06014.70
5.3.280.0070.07314.78
5.3.270.0130.07714.77
5.3.260.0070.04314.80
5.3.250.0030.05714.73
5.3.240.0100.06314.80
5.3.230.0100.05014.60
5.3.220.0070.05714.73
5.3.210.0070.04314.75
5.3.200.0030.04014.63
5.3.190.0100.08314.70
5.3.180.0130.08014.57
5.3.170.0200.05714.73
5.3.160.0100.05714.57
5.3.150.0100.04314.63
5.3.140.0100.03314.74
5.3.130.0070.05014.62
5.3.120.0200.02314.73
5.3.110.0030.07714.71
5.3.100.0030.03714.05
5.3.90.0030.03714.03
5.3.80.0130.07714.14
5.3.70.0070.07713.98
5.3.60.0070.07714.07
5.3.50.0100.03314.11
5.3.40.0130.05314.02
5.3.30.0130.06713.92
5.3.20.0130.07313.82
5.3.10.0100.04713.83
5.3.00.0070.07713.77
5.2.170.0000.03712.16
5.2.160.0170.05312.16
5.2.150.0130.06012.16
5.2.140.0100.03312.16
5.2.130.0100.03312.16
5.2.120.0070.06712.16
5.2.110.0030.05712.16
5.2.100.0070.06312.16
5.2.90.0130.04712.16
5.2.80.0100.06012.16
5.2.70.0130.05312.16
5.2.60.0230.06012.16
5.2.50.0100.05312.16
5.2.40.0100.04312.16
5.2.30.0170.05312.16
5.2.20.0170.05712.16
5.2.10.0100.06012.16
5.2.00.0030.05312.16
5.1.60.0100.04012.16
5.1.50.0030.03312.16
5.1.40.0100.05312.16
5.1.30.0170.05712.16
5.1.20.0070.06712.16
5.1.10.0170.05312.16
5.1.00.0130.04312.16
5.0.50.0100.04312.16
5.0.40.0100.03712.16
5.0.30.0070.05012.16
5.0.20.0030.03312.16
5.0.10.0070.03712.16
5.0.00.0070.03712.16
4.4.90.0130.02312.16
4.4.80.0000.02312.16
4.4.70.0100.03312.16
4.4.60.0070.03712.16
4.4.50.0130.01712.16
4.4.40.0070.05012.16
4.4.30.0070.03012.16
4.4.20.0030.05012.16
4.4.10.0130.02012.16
4.4.00.0100.05312.16
4.3.110.0130.03012.16
4.3.100.0070.02712.16
4.3.90.0000.02012.16
4.3.80.0070.02312.16
4.3.70.0100.03012.16
4.3.60.0100.02712.16
4.3.50.0070.02712.16
4.3.40.0030.03012.16
4.3.30.0030.02012.16
4.3.20.0030.01712.16
4.3.10.0100.01312.16
4.3.00.0030.02012.16

preferences:
61.2 ms | 401 KiB | 5 Q