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', ), ); 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.0070.01417.00
8.3.50.0050.01422.04
8.3.40.0110.01119.02
8.3.30.0140.00019.19
8.3.20.0080.00020.20
8.3.10.0030.00620.36
8.3.00.0030.00519.24
8.2.180.0090.00617.00
8.2.170.0100.01022.96
8.2.160.0070.00720.53
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0000.00826.16
8.2.120.0000.00820.98
8.2.110.0090.00022.26
8.2.100.0080.00419.64
8.2.90.0040.00419.35
8.2.80.0030.00517.97
8.2.70.0030.00617.63
8.2.60.0040.00418.04
8.2.50.0000.00818.07
8.2.40.0060.00318.28
8.2.30.0070.00419.54
8.2.20.0060.00317.85
8.2.10.0080.00018.14
8.2.00.0000.00717.66
8.1.280.0070.01425.92
8.1.270.0030.00623.96
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0030.00623.86
8.1.230.0000.01119.01
8.1.220.0050.00317.78
8.1.210.0000.00918.77
8.1.200.0070.00317.35
8.1.190.0050.00317.35
8.1.180.0080.00018.10
8.1.170.0030.00518.59
8.1.160.0030.00522.06
8.1.150.0040.00418.99
8.1.140.0080.00017.41
8.1.130.0000.00717.88
8.1.120.0070.00017.59
8.1.110.0000.00717.55
8.1.100.0070.00017.39
8.1.90.0040.00417.51
8.1.80.0030.00317.52
8.1.70.0030.00317.45
8.1.60.0030.00617.53
8.1.50.0080.00017.56
8.1.40.0050.00317.54
8.1.30.0030.00517.64
8.1.20.0040.00417.68
8.1.10.0040.00417.55
8.1.00.0000.00817.47
8.0.300.0040.00418.77
8.0.290.0000.00716.88
8.0.280.0040.00418.52
8.0.270.0000.00717.37
8.0.260.0030.00317.21
8.0.250.0030.00517.04
8.0.240.0000.00716.96
8.0.230.0040.00417.09
8.0.220.0040.00417.04
8.0.210.0000.00716.89
8.0.200.0030.00616.96
8.0.190.0070.00016.93
8.0.180.0040.00416.85
8.0.170.0040.00417.00
8.0.160.0020.00516.77
8.0.150.0000.00716.73
8.0.140.0070.00016.96
8.0.130.0000.00713.30
8.0.120.0000.00717.00
8.0.110.0000.00816.92
8.0.100.0040.00416.94
8.0.90.0000.00716.95
8.0.80.0100.00716.89
8.0.70.0000.00716.97
8.0.60.0000.00716.93
8.0.50.0000.00716.99
8.0.30.0080.01416.96
8.0.20.0170.00517.40
8.0.10.0000.00716.91
8.0.00.0110.00916.84
7.4.330.0050.00015.00
7.4.320.0030.00616.64
7.4.300.0060.00016.65
7.4.290.0030.00316.54
7.4.280.0000.00716.62
7.4.270.0000.00816.57
7.4.260.0030.00416.53
7.4.250.0070.00016.51
7.4.240.0010.00616.63
7.4.230.0030.00316.76
7.4.220.0180.00616.65
7.4.210.0080.00616.74
7.4.200.0000.00816.46
7.4.160.0100.00616.56
7.4.150.0090.00917.40
7.4.140.0130.00817.86
7.4.130.0060.01116.64
7.4.120.0120.00516.54
7.4.110.0080.00816.75
7.4.100.0070.01016.52
7.4.90.0060.01116.68
7.4.80.0080.01219.39
7.4.70.0070.01016.49
7.4.60.0100.00716.50
7.4.50.0040.00416.63
7.4.40.0000.01616.61
7.4.30.0060.01016.40
7.4.00.0040.01115.01
7.3.330.0050.00013.20
7.3.320.0000.00513.32
7.3.310.0000.00716.47
7.3.300.0030.00316.28
7.3.290.0030.01816.33
7.3.280.0050.01116.41
7.3.270.0120.00617.40
7.3.260.0060.00916.39
7.3.250.0070.01016.43
7.3.240.0090.00916.62
7.3.230.0060.01216.60
7.3.210.0070.01116.37
7.3.200.0090.00919.39
7.3.190.0050.01416.69
7.3.180.0090.00916.44
7.3.170.0130.00316.52
7.3.160.0170.00316.41
7.2.330.0090.00916.68
7.2.320.0000.01816.72
7.2.310.0160.00816.87
7.2.300.0110.00716.59
7.2.290.0090.00916.94
7.2.60.0030.01316.75
7.2.00.0060.00619.61
7.1.200.0120.00015.44
7.1.100.0000.00918.44
7.1.70.0030.00917.08
7.1.60.0070.01719.61
7.1.50.0040.00716.92
7.1.00.0070.07322.40
7.0.200.0190.00614.86
7.0.140.0070.07322.21
7.0.60.0100.07719.98
7.0.50.0000.05018.01
7.0.40.0130.08320.40
7.0.30.0530.07720.10
7.0.20.0230.04320.12
7.0.10.0230.05020.08
7.0.00.0030.05320.09
5.6.280.0030.07021.04
5.6.210.0130.08720.52
5.6.200.0170.07018.25
5.6.190.0130.08320.52
5.6.180.0300.06320.77
5.6.170.0230.06720.56
5.6.160.0070.04320.54
5.6.150.0070.08718.25
5.6.140.0170.06718.24
5.6.130.0070.04318.22
5.6.120.0200.07321.19
5.6.110.0030.09021.06
5.6.100.0130.05721.01
5.6.90.0070.08720.92
5.6.80.0100.08020.45
5.6.70.3970.03020.45
5.5.350.0130.07720.50
5.5.340.0100.08018.05
5.5.330.0100.07320.27
5.5.320.0430.07320.30
5.5.310.0170.04720.38
5.5.300.0000.05318.00
5.5.290.0200.05018.07
5.5.280.0130.07320.84
5.5.270.0100.04721.00
5.5.260.0170.03021.00
5.5.250.0070.05720.62
5.5.240.4130.03720.21
5.4.450.0270.04019.39
5.4.440.0300.04719.57
5.4.430.0500.06019.56
5.4.420.0670.04319.48
5.4.410.0700.03319.19
5.4.400.0500.03319.22
5.4.390.0430.03319.09
5.4.380.0230.06018.52
5.4.370.0270.05318.71
5.4.360.0330.05318.79
5.4.350.0330.05318.77
5.4.340.0270.05318.61
5.4.320.0100.04212.55
5.4.310.0120.03712.55
5.4.300.0100.03612.55
5.4.290.0130.03612.55
5.4.280.0080.03912.45
5.4.270.0100.03612.45
5.4.260.0090.03812.44
5.4.250.0110.03612.45
5.4.240.0080.03812.45
5.4.230.0150.03312.44
5.4.220.0070.04912.44
5.4.210.0140.03112.44
5.4.200.0090.03912.44
5.4.190.0120.03712.44
5.4.180.0080.04212.43
5.4.170.0120.03512.45
5.4.160.0130.03512.44
5.4.150.0080.03812.43
5.4.140.0080.04012.12
5.4.130.0100.03812.11
5.4.120.0160.05012.06
5.4.110.0080.03912.05
5.4.100.0070.04012.06
5.4.90.0090.04412.06
5.4.80.0120.04212.06
5.4.70.0100.03712.05
5.4.60.0080.04012.05
5.4.50.0100.03712.05
5.4.40.0140.03312.05
5.4.30.0120.03512.04
5.4.20.0110.03412.04
5.4.10.0080.03912.04
5.4.00.0080.04811.53
5.3.290.0110.03912.80
5.3.280.0050.04912.73
5.3.270.0130.03712.74
5.3.260.0100.04012.73
5.3.250.0100.03812.73
5.3.240.0110.03712.73
5.3.230.0070.04312.73
5.3.220.0090.03812.70
5.3.210.0090.03912.70
5.3.200.0140.03712.71
5.3.190.0050.04412.70
5.3.180.0160.03512.69
5.3.170.0090.03712.70
5.3.160.0130.03812.69
5.3.150.0110.03612.69
5.3.140.0090.03912.69
5.3.130.0120.03812.68
5.3.120.0180.03512.68
5.3.110.0160.03512.68
5.3.100.0070.04012.17
5.3.90.0100.04012.15
5.3.80.0100.03612.14
5.3.70.0100.04012.14
5.3.60.0110.03612.13
5.3.50.0090.03912.07
5.3.40.0150.03412.07
5.3.30.0110.03512.03
5.3.20.0120.03411.81
5.3.10.0130.03811.78
5.3.00.0130.03711.77
5.2.170.0110.0379.27
5.2.160.0100.0299.27
5.2.150.0110.0329.27
5.2.140.0090.0429.27
5.2.130.0100.0309.23
5.2.120.0090.0289.23
5.2.110.0100.0319.24
5.2.100.0070.0319.23
5.2.90.0070.0319.23
5.2.80.0070.0379.23
5.2.70.0090.0369.23
5.2.60.0130.0439.18
5.2.50.0080.0329.15
5.2.40.0120.0289.13
5.2.30.0040.0349.11
5.2.20.0110.0319.09
5.2.10.0110.0299.00
5.2.00.0100.0288.86
5.1.60.0090.0238.14
5.1.50.0100.0258.14
5.1.40.0120.0238.13
5.1.30.0080.0288.48
5.1.20.0100.0298.50
5.1.10.0060.0288.21
5.1.00.0060.0288.22
5.0.50.0090.0206.71
5.0.40.0080.0216.56
5.0.30.0070.0326.38
5.0.20.0060.0216.34
5.0.10.0090.0186.32
5.0.00.0130.0316.33
4.4.90.0070.0184.78
4.4.80.0060.0164.75
4.4.70.0090.0134.76
4.4.60.0080.0144.75
4.4.50.0070.0194.77
4.4.40.0040.0344.71
4.4.30.0050.0174.76
4.4.20.0060.0164.84
4.4.10.0040.0174.85
4.4.00.0060.0264.76
4.3.110.0070.0154.67
4.3.100.0050.0194.67
4.3.90.0090.0124.64
4.3.80.0080.0234.63
4.3.70.0080.0144.63
4.3.60.0060.0154.62
4.3.50.0030.0194.63
4.3.40.0060.0254.58
4.3.30.0060.0173.39
4.3.20.0050.0173.37
4.3.10.0080.0133.32
4.3.00.0100.01313.95

preferences:
52.27 ms | 401 KiB | 5 Q