3v4l.org

run code in 300+ PHP versions simultaneously
<?php $configArray = array( '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', ), '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', ), ); 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.0140.00716.75
8.3.50.0160.00521.95
8.3.40.0090.01218.85
8.3.30.0090.00619.09
8.3.20.0040.00420.35
8.3.10.0060.00320.57
8.3.00.0040.00419.38
8.2.180.0090.00616.38
8.2.170.0070.00722.96
8.2.160.0090.00520.35
8.2.150.0070.01124.18
8.2.140.0080.00024.66
8.2.130.0080.00026.16
8.2.120.0040.00421.01
8.2.110.0090.00021.02
8.2.100.0070.00418.16
8.2.90.0040.00419.17
8.2.80.0040.00417.97
8.2.70.0030.00617.63
8.2.60.0080.00018.05
8.2.50.0030.00618.07
8.2.40.0040.00418.09
8.2.30.0070.00419.49
8.2.20.0030.00617.70
8.2.10.0040.00418.16
8.2.00.0030.00517.71
8.1.280.0090.00925.92
8.1.270.0040.00423.79
8.1.260.0070.00026.35
8.1.250.0070.00028.09
8.1.240.0060.00321.43
8.1.230.0040.00819.28
8.1.220.0080.00017.74
8.1.210.0050.00318.77
8.1.200.0030.00617.48
8.1.190.0090.00017.22
8.1.180.0040.00418.10
8.1.170.0080.00018.71
8.1.160.0040.00421.98
8.1.150.0000.00718.94
8.1.140.0080.00017.49
8.1.130.0000.00717.87
8.1.120.0070.00017.41
8.1.110.0000.00717.50
8.1.100.0000.00717.41
8.1.90.0000.00717.35
8.1.80.0050.00217.53
8.1.70.0000.00717.50
8.1.60.0030.00617.59
8.1.50.0000.00817.59
8.1.40.0000.00817.46
8.1.30.0000.00817.60
8.1.20.0040.00417.66
8.1.10.0050.00217.52
8.1.00.0060.00317.57
8.0.300.0070.00018.77
8.0.290.0040.00416.75
8.0.280.0070.00018.49
8.0.270.0040.00317.32
8.0.260.0050.00217.38
8.0.250.0030.00316.88
8.0.240.0070.00017.02
8.0.230.0040.00416.99
8.0.220.0000.00716.91
8.0.210.0000.00716.92
8.0.200.0040.00417.08
8.0.190.0050.00217.04
8.0.180.0040.00416.96
8.0.170.0080.00016.84
8.0.160.0000.00717.07
8.0.150.0000.00716.83
8.0.140.0040.00416.87
8.0.130.0060.00013.44
8.0.120.0040.00416.90
8.0.110.0070.00016.82
8.0.100.0000.00716.84
8.0.90.0040.00416.91
8.0.80.0080.00816.96
8.0.70.0040.00416.92
8.0.60.0040.00416.95
8.0.50.0000.00716.96
8.0.30.0070.01417.20
8.0.20.0110.00717.40
8.0.10.0040.00417.06
8.0.00.0090.01216.96
7.4.330.0000.00515.09
7.4.320.0040.00416.69
7.4.300.0030.00316.63
7.4.290.0030.00316.54
7.4.280.0050.00216.68
7.4.270.0040.00416.66
7.4.260.0030.00316.52
7.4.250.0080.00016.61
7.4.240.0040.00316.67
7.4.230.0070.00016.54
7.4.220.0130.00616.60
7.4.210.0040.01116.51
7.4.200.0000.00816.58
7.4.160.0100.00616.60
7.4.150.0140.00417.40
7.4.140.0060.01117.86
7.4.130.0080.00816.60
7.4.120.0090.00816.65
7.4.110.0100.00716.62
7.4.100.0140.01016.61
7.4.90.0030.01416.71
7.4.80.0030.01319.39
7.4.70.0070.01416.52
7.4.60.0060.00916.54
7.4.50.0000.00816.72
7.4.40.0120.00316.25
7.4.30.0120.00316.46
7.4.10.0030.01415.18
7.4.00.0050.01114.96
7.3.330.0000.00513.48
7.3.320.0050.00013.27
7.3.310.0030.00316.41
7.3.300.0000.00716.27
7.3.290.0060.01016.37
7.3.280.0080.01116.35
7.3.270.0080.01117.40
7.3.260.0130.00316.57
7.3.250.0120.00716.48
7.3.240.0100.01016.39
7.3.230.0060.01016.48
7.3.210.0100.00616.49
7.3.200.0130.01019.39
7.3.190.0110.00516.36
7.3.180.0060.00916.69
7.3.170.0120.00416.72
7.3.160.0070.00916.42
7.3.130.0060.01214.80
7.3.120.0090.00914.99
7.3.110.0120.00614.80
7.3.100.0060.01214.76
7.3.90.0090.00514.73
7.3.80.0060.00814.69
7.3.70.0070.00514.95
7.3.60.0090.00414.94
7.3.50.0070.00914.63
7.3.40.0110.00614.96
7.3.30.0030.00914.75
7.3.20.0080.00416.59
7.3.10.0130.00316.64
7.3.00.0050.00616.77
7.2.330.0060.01216.88
7.2.320.0060.01216.71
7.2.310.0030.01916.87
7.2.300.0160.00516.71
7.2.290.0090.00916.77
7.2.260.0030.01215.16
7.2.250.0100.00615.15
7.2.240.0020.01514.92
7.2.230.0030.01014.93
7.2.220.0050.00715.15
7.2.210.0040.00714.95
7.2.200.0050.01015.05
7.2.190.0000.01015.14
7.2.180.0080.00814.96
7.2.170.0030.01215.10
7.2.160.0090.00415.02
7.2.150.0060.00917.03
7.2.140.0070.01016.89
7.2.130.0100.00316.89
7.2.120.0020.01416.97
7.2.110.0060.00916.98
7.2.100.0050.01016.90
7.2.90.0060.00717.03
7.2.80.0010.01216.80
7.2.70.0050.01117.00
7.2.60.0070.00816.87
7.2.50.0050.01116.87
7.2.40.0050.00916.91
7.2.30.0080.00816.95
7.2.20.0080.00816.95
7.2.10.0100.00616.79
7.2.00.0070.00917.82
7.1.330.0050.00915.91
7.1.320.0090.00616.04
7.1.310.0030.00915.80
7.1.300.0090.00515.90
7.1.290.0030.01015.83
7.1.280.0040.00915.84
7.1.270.0020.01215.89
7.1.260.0090.00515.83
7.1.250.0040.00415.73
7.1.240.0080.00315.87
7.1.230.0080.00315.79
7.1.220.0080.00215.59
7.1.210.0080.00515.86
7.1.200.0050.00415.59
7.1.190.0060.00315.75
7.1.180.0060.00815.83
7.1.170.0040.01015.78
7.1.160.0070.00615.74
7.1.150.0050.00515.86
7.1.140.0060.00315.74
7.1.130.0060.00315.82
7.1.120.0070.00515.80
7.1.110.0050.01015.76
7.1.100.0060.00716.58
7.1.90.0070.00815.58
7.1.80.0100.00515.70
7.1.70.0010.00916.04
7.1.60.0050.01317.08
7.1.50.0070.00616.12
7.1.40.0020.01215.86
7.1.30.0040.00815.49
7.1.20.0080.00615.90
7.1.10.0010.01015.79
7.1.00.0090.03118.05
7.0.330.0030.01115.28
7.0.320.0070.00715.27
7.0.310.0070.00415.44
7.0.300.0080.00715.44
7.0.290.0070.00915.39
7.0.280.0020.01015.33
7.0.270.0060.00615.27
7.0.260.0030.01015.31
7.0.250.0000.01015.51
7.0.240.0050.00615.33
7.0.230.0070.00915.53
7.0.220.0070.00615.13
7.0.210.0070.00815.43
7.0.200.0170.01015.15
7.0.190.0070.00815.23
7.0.180.0080.00515.43
7.0.170.0060.00815.47
7.0.160.0040.01015.15
7.0.150.0040.01015.52
7.0.140.0070.03017.65
7.0.130.0050.00815.45
7.0.120.0120.00515.47
7.0.110.0070.03516.97
7.0.100.0080.03116.88
7.0.90.0080.01916.93
7.0.80.0080.03216.84
7.0.70.0070.02616.92
7.0.60.0110.01916.91
7.0.50.0050.03617.09
7.0.40.0070.02815.76
7.0.30.0080.03215.68
7.0.20.0060.02915.73
7.0.10.0110.03015.70
7.0.00.0080.03015.73
5.6.400.0050.01214.19
5.6.390.0060.00514.43
5.6.380.0060.00914.57
5.6.370.0060.00814.73
5.6.360.0090.00714.43
5.6.350.0070.00814.53
5.6.340.0070.00714.60
5.6.330.0070.00914.43
5.6.320.0060.00714.32
5.6.310.0090.00514.31
5.6.300.0060.01114.35
5.6.290.0050.00914.62
5.6.280.0040.03216.70
5.6.270.0040.01014.40
5.6.260.0050.01014.54
5.6.250.0090.03016.68
5.6.240.0050.03316.58
5.6.230.0060.02216.56
5.6.220.0070.03216.54
5.6.210.0070.03116.53
5.6.200.0070.03316.63
5.6.190.0090.01716.68
5.6.180.0070.03316.68
5.6.170.0080.03116.59
5.6.160.0080.02916.53
5.6.150.0020.03416.58
5.6.140.0070.03216.65
5.6.130.0080.02916.58
5.6.120.0060.03316.71
5.6.110.0080.03016.62
5.6.100.0070.03216.67
5.6.90.0070.03016.49
5.6.80.0080.03216.36
5.6.70.0050.03316.39
5.6.60.0090.02816.42
5.6.50.0040.03416.32
5.6.40.0100.02816.40
5.6.30.0080.03316.30
5.6.20.0030.02416.53
5.6.10.0050.03416.38
5.6.00.0020.03816.30
5.5.380.0120.02816.44
5.5.370.0020.03716.27
5.5.360.0060.02216.47
5.5.350.0060.02916.40
5.5.340.0100.02716.65
5.5.330.0070.02816.38
5.5.320.0050.02216.55
5.5.310.0070.03216.58
5.5.300.0090.03116.52
5.5.290.0090.03116.60
5.5.280.0070.03416.59
5.5.270.0060.03416.71
5.5.260.0040.02416.73
5.5.250.0080.02716.51
5.5.240.0070.03016.28
5.5.230.0070.03316.39
5.5.220.0050.02316.28
5.5.210.0090.02716.40
5.5.200.0070.03216.31
5.5.190.0030.03416.33
5.5.180.0090.03016.33
5.5.170.0060.01114.00
5.5.160.0020.03416.34
5.5.150.0060.03116.24
5.5.140.0040.03316.43
5.5.130.0020.03416.17
5.5.120.0080.03016.25
5.5.110.0040.03316.26
5.5.100.0030.02516.24
5.5.90.0120.02516.11
5.5.80.0050.03416.25
5.5.70.0060.02016.17
5.5.60.0110.02716.34
5.5.50.0060.03216.29
5.5.40.0060.01816.14
5.5.30.0040.03416.06
5.5.20.0040.02916.30
5.5.10.0070.02716.33
5.5.00.0060.03016.02
5.4.450.0080.01813.92
5.4.440.0050.03113.99
5.4.430.0040.02214.02
5.4.420.0100.02313.79
5.4.410.0060.01913.66
5.4.400.0030.03213.83
5.4.390.0060.02913.80
5.4.380.0080.02513.84
5.4.370.0060.02913.59
5.4.360.0090.02013.72
5.4.350.0030.02913.76
5.4.340.0080.02413.80
5.4.330.0040.00911.06
5.4.320.0070.03013.87
5.4.310.0110.02413.82
5.4.300.0040.03113.75
5.4.290.0060.02213.65
5.4.280.0030.02713.70
5.4.270.0090.02313.90
5.4.260.0050.03013.57
5.4.250.0100.02613.80
5.4.240.0050.03113.76
5.4.230.0050.03213.62
5.4.220.0060.01813.90
5.4.210.0070.02113.67
5.4.200.0040.02813.60
5.4.190.0080.02913.94
5.4.180.0020.03213.68
5.4.170.0030.03213.69
5.4.160.0050.02413.78
5.4.150.0080.02813.64
5.4.140.0050.01912.69
5.4.130.0060.01912.87
5.4.120.0060.02812.79
5.4.110.0080.02812.87
5.4.100.0010.02812.84
5.4.90.0050.02913.00
5.4.80.0060.02613.00
5.4.70.0080.02312.87
5.4.60.0060.02912.89
5.4.50.0090.01312.97
5.4.40.0090.02713.05
5.4.30.0090.02213.06
5.4.20.0030.02912.81
5.4.10.0090.02412.91
5.4.00.0060.02012.70
5.3.290.0100.07014.68
5.3.280.0100.07314.71
5.3.270.0130.06714.75
5.3.260.0030.04314.62
5.3.250.0100.07314.58
5.3.240.0100.07014.77
5.3.230.0100.07014.60
5.3.220.0070.07314.55
5.3.210.0200.05714.55
5.3.200.0100.05714.82
5.3.190.0070.05314.60
5.3.180.0030.08014.61
5.3.170.0070.05014.72
5.3.160.0170.07014.62
5.3.150.0000.05314.57
5.3.140.0130.06014.70
5.3.130.0030.08714.58
5.3.120.0200.06714.58
5.3.110.0070.07714.43
5.3.100.0130.06314.07
5.3.90.0000.07714.17
5.3.80.0100.07014.05
5.3.70.0030.08014.05
5.3.60.0030.04714.16
5.3.50.0100.07014.09
5.3.40.0170.06313.98
5.3.30.0070.04714.04
5.3.20.0100.07313.70
5.3.10.0100.07013.80
5.3.00.0030.08313.68
5.2.170.0130.05011.16
5.2.160.0030.04011.18
5.2.150.0130.03711.30
5.2.140.0030.06311.18
5.2.130.0070.05311.20
5.2.120.0100.04011.21
5.2.110.0070.06011.11
5.2.100.0000.06711.21
5.2.90.0100.05711.12
5.2.80.0030.04311.24
5.2.70.0070.05011.21
5.2.60.0100.05311.30
5.2.50.0130.05711.03
5.2.40.0070.05711.01
5.2.30.0070.06311.00
5.2.20.0070.06011.07
5.2.10.0070.06010.90
5.2.00.0070.05710.71
5.1.60.0070.04710.02
5.1.50.0000.03710.10
5.1.40.0070.05010.15
5.1.30.0030.06010.32
5.1.20.0030.05710.50
5.1.10.0070.04710.27
5.1.00.0030.05010.09
5.0.50.0070.0438.75
5.0.40.0070.0438.40
5.0.30.0000.0538.31
5.0.20.0070.0438.21
5.0.10.0000.0408.26
5.0.00.0030.0638.21
4.4.90.0000.0378.21
4.4.80.0100.0308.21
4.4.70.0070.0278.21
4.4.60.0030.0338.21
4.4.50.0030.0338.21
4.4.40.0070.0508.21
4.4.30.0070.0338.21
4.4.20.0000.0238.21
4.4.10.0070.0178.21
4.4.00.0070.0508.21
4.3.110.0030.0378.21
4.3.100.0070.0308.21
4.3.90.0070.0308.21
4.3.80.0000.0438.21
4.3.70.0070.0308.21
4.3.60.0030.0338.21
4.3.50.0030.0308.21
4.3.40.0000.0538.21
4.3.30.0000.0378.21
4.3.20.0030.0378.21
4.3.10.0070.0178.21
4.3.00.0030.0308.21

preferences:
49.94 ms | 401 KiB | 5 Q