3v4l.org

run code in 300+ PHP versions simultaneously
<?php $configArray = json_decode('{"nominal":{"class":"sales\/quote_address_total_nominal","before":["subtotal"],"renderer":"checkout\/total_nominal","after":[],"_code":"nominal"},"subtotal":{"class":"sales\/quote_address_total_subtotal","after":["nominal"],"before":["grand_total"],"renderer":"tax\/checkout_subtotal","admin_renderer":"adminhtml\/sales_order_create_totals_subtotal","_code":"subtotal"},"shipping":{"class":"sales\/quote_address_total_shipping","after":["subtotal","freeshipping","tax_subtotal"],"before":["grand_total"],"renderer":"tax\/checkout_shipping","admin_renderer":"adminhtml\/sales_order_create_totals_shipping","_code":"shipping"},"grand_total":{"class":"sales\/quote_address_total_grand","after":["subtotal"],"renderer":"tax\/checkout_grandtotal","admin_renderer":"adminhtml\/sales_order_create_totals_grandtotal","before":[],"_code":"grand_total"},"msrp":{"class":"sales\/quote_address_total_msrp","before":[],"after":[],"_code":"msrp"},"freeshipping":{"class":"salesrule\/quote_freeshipping","after":["subtotal"],"before":["tax_subtotal","shipping"],"_code":"freeshipping"},"discount":{"class":"salesrule\/quote_discount","after":["subtotal","shipping"],"before":["grand_total"],"renderer":"tax\/checkout_discount","admin_renderer":"adminhtml\/sales_order_create_totals_discount","_code":"discount"},"tax_subtotal":{"class":"tax\/sales_total_quote_subtotal","after":["freeshipping"],"before":["tax","discount"],"_code":"tax_subtotal"},"tax_shipping":{"class":"tax\/sales_total_quote_shipping","after":["shipping","tax_subtotal"],"before":["tax","discount"],"_code":"tax_shipping"},"tax":{"class":"tax\/sales_total_quote_tax","after":["subtotal","shipping","discount"],"before":["grand_total"],"renderer":"tax\/checkout_tax","admin_renderer":"adminhtml\/sales_order_create_totals_tax","_code":"tax"},"weee":{"class":"weee\/total_quote_weee","after":["subtotal","tax_subtotal"],"before":["shipping","tax","discount"],"_code":"weee"}}', true); 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, function($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; }); 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.0140.00016.75
8.3.50.0100.01021.16
8.3.40.0100.00718.97
8.3.30.0040.01118.84
8.3.20.0040.00420.38
8.3.10.0080.00023.61
8.3.00.0080.00023.55
8.2.180.0070.01416.63
8.2.170.0110.00722.96
8.2.160.0070.01020.52
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0040.00419.85
8.2.120.0040.00426.35
8.2.110.0080.00319.21
8.2.100.0120.00017.97
8.2.90.0000.00919.34
8.2.80.0040.00417.97
8.2.70.0060.00317.63
8.2.60.0030.00517.93
8.2.50.0000.00818.07
8.2.40.0000.01022.20
8.2.30.0000.00719.54
8.2.20.0040.00417.83
8.2.10.0030.00518.20
8.2.00.0000.00818.14
8.1.280.0140.00025.92
8.1.270.0060.00320.32
8.1.260.0050.00328.09
8.1.250.0080.00028.09
8.1.240.0060.00321.43
8.1.230.0120.00017.52
8.1.220.0000.00817.79
8.1.210.0030.00618.77
8.1.200.0070.00317.35
8.1.190.0040.00417.35
8.1.180.0030.00518.10
8.1.170.0090.00018.47
8.1.160.0040.00420.76
8.1.150.0070.00018.88
8.1.140.0080.00019.52
8.1.130.0070.00017.60
8.1.120.0040.00417.52
8.1.110.0000.00717.49
8.1.100.0000.00717.55
8.1.90.0070.00017.39
8.1.80.0040.00417.39
8.1.70.0040.00417.51
8.1.60.0060.00317.55
8.1.50.0000.00817.54
8.1.40.0000.00817.56
8.1.30.0040.00417.70
8.1.20.0040.00417.61
8.1.10.0040.00417.57
8.1.00.0000.00817.40
8.0.300.0070.00018.77
8.0.290.0050.00216.75
8.0.280.0070.00018.39
8.0.270.0000.00717.29
8.0.260.0060.00017.30
8.0.250.0000.00716.96
8.0.240.0060.00317.12
8.0.230.0040.00417.02
8.0.220.0000.00716.97
8.0.210.0070.00016.85
8.0.200.0000.00716.96
8.0.190.0040.00416.97
8.0.180.0070.00017.03
8.0.170.0030.00516.99
8.0.160.0070.00016.83
8.0.150.0040.00416.96
8.0.140.0070.00016.81
8.0.130.0000.00713.36
8.0.120.0060.00316.91
8.0.110.0090.00016.93
8.0.100.0030.00616.94
8.0.90.0000.00717.02
8.0.80.0060.01216.92
8.0.70.0040.00416.84
8.0.60.0070.00016.89
8.0.50.0050.00216.86
8.0.30.0070.01017.25
8.0.20.0110.00917.40
8.0.10.0000.00817.03
8.0.00.0090.01316.87
7.4.330.0000.00516.70
7.4.320.0000.00616.67
7.4.300.0030.00316.68
7.4.290.0060.00316.59
7.4.280.0050.00516.52
7.4.270.0000.00716.55
7.4.260.0000.00816.53
7.4.250.0080.00016.51
7.4.240.0040.00416.58
7.4.230.0000.00716.37
7.4.220.0120.00616.48
7.4.210.0060.01616.60
7.4.200.0070.00016.69
7.4.160.0100.00616.59
7.4.150.0060.01317.40
7.4.140.0100.01017.86
7.4.130.0150.00316.53
7.4.120.0110.00916.49
7.4.110.0090.01116.58
7.4.100.0140.00316.62
7.4.90.0070.01016.58
7.4.80.0130.00919.39
7.4.70.0000.01716.34
7.4.60.0030.01416.66
7.4.50.0040.01116.42
7.4.40.0030.01316.64
7.4.30.0060.01116.62
7.4.00.0090.00814.96
7.3.330.0050.00013.49
7.3.320.0030.00313.40
7.3.310.0090.00016.40
7.3.300.0030.00516.42
7.3.290.0070.01016.45
7.3.280.0070.01216.40
7.3.270.0100.00717.40
7.3.260.0100.00616.58
7.3.240.0060.01516.43
7.3.230.0000.01816.61
7.3.210.0100.01016.44
7.3.200.0060.00916.47
7.3.190.0130.00316.36
7.3.180.0130.00316.49
7.3.170.0110.00616.39
7.3.160.0030.01316.57
7.3.120.0090.00914.72
7.3.110.0070.01114.71
7.3.100.0030.01214.84
7.3.90.0110.00715.04
7.3.80.0030.00714.93
7.3.70.0090.00615.04
7.3.60.0110.00714.98
7.3.50.0080.00414.53
7.3.40.0030.01014.64
7.3.30.0150.00314.66
7.3.20.0070.00716.86
7.3.10.0100.01016.63
7.3.00.0130.00616.88
7.2.330.0060.01216.74
7.2.320.0120.00616.50
7.2.310.0040.01416.59
7.2.300.0060.01216.45
7.2.290.0060.01216.80
7.2.250.0080.01214.91
7.2.240.0000.02115.19
7.2.230.0000.01515.09
7.2.220.0100.00715.41
7.2.210.0060.00315.22
7.2.200.0030.00615.17
7.2.190.0090.00415.08
7.2.180.0030.01115.00
7.2.170.0070.00715.29
7.2.60.0080.00416.95
7.2.00.0060.00319.26
7.1.330.0030.01015.68
7.1.320.0090.00615.88
7.1.310.0000.01415.85
7.1.300.0000.01015.84
7.1.290.0040.00715.58
7.1.280.0130.00315.86
7.1.270.0070.00715.84
7.1.260.0030.01015.60
7.1.200.0070.00715.45
7.1.100.0060.00618.30
7.1.70.0060.00317.26
7.1.60.0110.01419.27
7.1.50.0030.01417.05
7.1.00.0000.07722.28
7.0.200.0100.00016.64
7.0.60.0130.08021.79
7.0.50.0070.08717.85
7.0.40.0170.06320.02
7.0.30.0200.04320.24
7.0.20.0300.07320.16
7.0.10.0030.09020.06
7.0.00.0070.07320.24
5.6.280.0030.03320.96
5.6.210.0170.07020.79
5.6.200.0030.04018.29
5.6.190.0100.06320.39
5.6.180.0470.05720.39
5.6.170.0230.06720.51
5.6.160.0100.06320.50
5.6.150.0030.04318.20
5.6.140.0030.04718.14
5.6.130.0100.09018.25
5.6.120.0070.04021.02
5.6.110.0100.08321.06
5.6.100.0100.08321.04
5.6.90.0070.09021.02
5.6.80.0130.06020.32
5.5.350.0030.04020.34
5.5.340.0070.08018.00
5.5.330.0130.06020.25
5.5.320.0730.05320.38
5.5.310.0230.04020.28
5.5.300.0030.08717.97
5.5.290.0100.03318.04
5.5.280.0100.06320.91
5.5.270.0100.09020.79
5.5.260.0230.07020.91
5.5.250.0130.07720.50
5.5.240.0200.07320.39

preferences:
41.16 ms | 401 KiB | 5 Q