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', ), 'vaimo_klarna_fee_tax' => array( '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.0070.01016.88
8.3.50.0080.01221.98
8.3.40.0110.00718.96
8.3.30.0070.00719.02
8.3.20.0000.00720.35
8.3.10.0090.00020.57
8.3.00.0000.00819.51
8.2.180.0040.01116.75
8.2.170.0120.00322.96
8.2.160.0100.00720.56
8.2.150.0060.00324.18
8.2.140.0080.00024.66
8.2.130.0080.00026.16
8.2.120.0040.00421.11
8.2.110.0090.00021.03
8.2.100.0060.00618.28
8.2.90.0040.00419.34
8.2.80.0030.00517.97
8.2.70.0040.00417.63
8.2.60.0040.00417.93
8.2.50.0000.00818.07
8.2.40.0000.00818.22
8.2.30.0030.00719.41
8.2.20.0080.00017.72
8.2.10.0040.00418.11
8.2.00.0050.00317.78
8.1.280.0100.01025.92
8.1.270.0040.00423.93
8.1.260.0090.00026.35
8.1.250.0040.00428.09
8.1.240.0030.01421.37
8.1.230.0120.00019.48
8.1.220.0030.00617.74
8.1.210.0040.00418.77
8.1.200.0000.00817.47
8.1.190.0030.00517.48
8.1.180.0060.00318.10
8.1.170.0000.00818.77
8.1.160.0040.00422.09
8.1.150.0000.00818.88
8.1.140.0040.00417.42
8.1.130.0030.00317.82
8.1.120.0000.00717.53
8.1.110.0000.00817.40
8.1.100.0000.00717.47
8.1.90.0050.00217.55
8.1.80.0040.00417.55
8.1.70.0000.00717.48
8.1.60.0030.00617.66
8.1.50.0040.00417.52
8.1.40.0090.00017.48
8.1.30.0000.00917.71
8.1.20.0040.00417.67
8.1.10.0050.00317.58
8.1.00.0060.00317.56
8.0.300.0040.00418.77
8.0.290.0040.00416.88
8.0.280.0000.00718.50
8.0.270.0070.00017.22
8.0.260.0070.00017.20
8.0.250.0000.00717.10
8.0.240.0030.00317.02
8.0.230.0000.00717.04
8.0.220.0000.00816.90
8.0.210.0000.00816.91
8.0.200.0050.00517.01
8.0.190.0040.00417.01
8.0.180.0040.00416.93
8.0.170.0000.00716.98
8.0.160.0050.00216.92
8.0.150.0040.00416.84
8.0.140.0040.00416.86
8.0.130.0000.00613.30
8.0.120.0000.00716.86
8.0.110.0040.00417.00
8.0.100.0000.00716.94
8.0.90.0050.00216.98
8.0.80.0120.00616.97
8.0.70.0040.00416.87
8.0.60.0040.00416.75
8.0.50.0040.00416.83
8.0.30.0180.00517.10
8.0.20.0040.01517.40
8.0.10.0040.00417.01
8.0.00.0080.01016.87
7.4.330.0000.00515.00
7.4.320.0040.00416.53
7.4.300.0030.00316.70
7.4.290.0040.00416.52
7.4.280.0050.00216.56
7.4.270.0070.00016.65
7.4.260.0040.00416.56
7.4.250.0030.00316.52
7.4.240.0020.00616.62
7.4.230.0050.00216.36
7.4.220.0100.01716.55
7.4.210.0070.00716.59
7.4.200.0070.00016.75
7.4.160.0120.00416.52
7.4.150.0100.01317.40
7.4.140.0110.01017.86
7.4.130.0050.01116.52
7.4.120.0080.01016.48
7.4.110.0080.00816.66
7.4.100.0170.00716.41
7.4.90.0100.00716.80
7.4.80.0140.00319.39
7.4.70.0100.01016.45
7.4.60.0070.01016.43
7.4.50.0050.00316.39
7.4.40.0100.00716.32
7.4.30.0100.00716.48
7.4.10.0060.01216.58
7.4.00.0080.00915.85
7.3.330.0000.00513.44
7.3.320.0000.00513.46
7.3.310.0030.00316.24
7.3.300.0070.00016.38
7.3.290.0090.00916.50
7.3.280.0060.01316.40
7.3.270.0060.01317.40
7.3.260.0100.01016.43
7.3.250.0080.00916.61
7.3.240.0090.01316.40
7.3.230.0150.00416.60
7.3.210.0030.01616.42
7.3.200.0100.01019.39
7.3.190.0070.01016.68
7.3.180.0100.00616.34
7.3.170.0070.01116.47
7.3.160.0060.01416.48
7.3.130.0130.00616.44
7.3.120.0100.00616.43
7.3.110.0100.00716.52
7.3.100.0000.01516.58
7.3.90.0100.00616.40
7.3.80.0030.01016.31
7.3.70.0000.01216.38
7.3.60.0080.00416.36
7.3.50.0070.00716.43
7.3.40.0100.01016.17
7.3.30.0120.00316.43
7.3.20.0030.01018.09
7.3.10.0000.01418.04
7.3.00.0060.00918.18
7.2.330.0140.00316.57
7.2.320.0110.00616.47
7.2.310.0070.01016.84
7.2.300.0030.01416.59
7.2.290.0140.00316.66
7.2.260.0100.01016.82
7.2.250.0070.01116.84
7.2.240.0040.01116.58
7.2.230.0040.00716.42
7.2.220.0040.00716.49
7.2.210.0000.01616.93
7.2.200.0040.01216.71
7.2.190.0030.00616.72
7.2.180.0080.00816.73
7.2.170.0040.01416.73
7.2.160.0000.01516.59
7.2.150.0000.01418.65
7.2.140.0070.01118.65
7.2.130.0040.01418.43
7.2.120.0000.01318.45
7.2.110.0100.00318.29
7.2.100.0060.00718.32
7.2.90.0000.01218.39
7.2.80.0070.01318.41
7.2.70.0070.01118.31
7.2.60.0070.00817.61
7.2.50.0040.01118.57
7.2.40.0100.00618.43
7.2.30.0020.01618.48
7.2.20.0120.00618.53
7.2.10.0070.01018.41
7.2.00.0070.00918.98
7.1.330.0060.00617.28
7.1.320.0080.00317.54
7.1.310.0000.00917.30
7.1.300.0060.00617.45
7.1.290.0040.01117.45
7.1.280.0100.01017.40
7.1.270.0030.00717.53
7.1.260.0030.00917.33
7.1.250.0130.00717.21
7.1.240.0090.00417.19
7.1.230.0070.01017.36
7.1.220.0040.01117.24
7.1.210.0030.00717.27
7.1.200.0030.01416.50
7.1.190.0120.00617.32
7.1.180.0000.01517.38
7.1.170.0030.01317.19
7.1.160.0000.00917.33
7.1.150.0050.00517.34
7.1.140.0060.00317.36
7.1.130.0080.00817.26
7.1.120.0030.01317.33
7.1.110.0120.00617.23
7.1.100.0020.01017.95
7.1.90.0080.00817.45
7.1.80.0000.01317.39
7.1.70.0060.00517.31
7.1.60.0070.01118.48
7.1.50.0050.00917.04
7.1.40.0120.00617.49
7.1.30.0030.01417.41
7.1.20.0070.00417.45
7.1.10.0060.00917.21
7.1.00.0050.04319.97
7.0.330.0130.00717.12
7.0.320.0070.01317.03
7.0.310.0110.01116.86
7.0.300.0120.00317.14
7.0.290.0110.01116.94
7.0.280.0070.01116.93
7.0.270.0070.01417.08
7.0.260.0130.01316.93
7.0.250.0070.01417.14
7.0.240.0150.00416.92
7.0.230.0100.01017.15
7.0.220.0130.01017.08
7.0.210.0030.01016.98
7.0.200.0250.00515.88
7.0.190.0170.00717.12
7.0.180.0150.00917.11
7.0.170.0100.01416.91
7.0.160.0070.01317.05
7.0.150.0030.01317.23
7.0.140.0050.04619.59
7.0.130.0150.00416.75
7.0.120.0070.01616.71
7.0.110.0120.04018.44
7.0.100.0130.04618.59
7.0.90.0070.02718.46
7.0.80.0170.03518.48
7.0.70.0100.04718.51
7.0.60.0130.04818.42
7.0.50.0100.02718.41
7.0.40.0080.02217.35
7.0.30.0090.03917.33
7.0.20.0100.04117.23
7.0.10.0090.02617.29
7.0.00.0100.04317.37
5.6.400.0070.01415.91
5.6.390.0160.00916.02
5.6.380.0140.01015.89
5.6.370.0100.01415.89
5.6.360.0060.01316.09
5.6.350.0150.01516.04
5.6.340.0070.01016.36
5.6.330.0130.01016.24
5.6.320.0140.01016.25
5.6.310.0180.00416.25
5.6.300.0040.01416.29
5.6.290.0120.00415.94
5.6.280.0160.03518.71
5.6.270.0160.01016.04
5.6.260.0070.02818.25
5.6.250.0030.02818.33
5.6.240.0110.04118.37
5.6.230.0030.02518.45
5.6.220.0110.03218.42
5.6.210.0120.03118.23
5.6.200.0100.04718.26
5.6.190.0130.02318.41
5.6.180.0090.02418.51
5.6.170.0120.04018.50
5.6.160.0150.04518.18
5.6.150.0100.02918.34
5.6.140.0100.02718.31
5.6.130.0130.02818.37
5.6.120.0110.04118.35
5.6.110.0120.04518.37
5.6.100.0100.04518.26
5.6.90.0170.03718.41
5.6.80.0120.04218.03
5.6.70.0130.03817.99
5.6.60.0100.03917.98
5.6.50.0150.01717.96
5.6.40.0100.03217.98
5.6.30.0140.04317.98
5.6.20.0100.04218.05
5.6.10.0120.03217.93
5.6.00.0140.04017.98
5.5.380.0140.04116.76
5.5.370.0080.04016.83
5.5.360.0120.03316.68
5.5.350.0110.04616.48
5.5.340.0110.04316.92
5.5.330.0130.03216.97
5.5.320.0050.02916.97
5.5.310.0090.02717.02
5.5.300.0110.02616.91
5.5.290.0080.04517.21
5.5.280.0150.04117.06
5.5.270.0050.04916.96
5.5.260.0120.02516.94
5.5.250.0130.02616.97
5.5.240.0240.03516.68
5.5.230.0110.04816.63
5.5.220.0120.03816.72
5.5.210.0140.03916.51
5.5.200.0100.04516.65
5.5.190.0140.04016.57
5.5.180.0110.04116.59
5.5.170.0100.00715.97
5.5.160.0130.02216.64
5.5.150.0170.04016.84
5.5.140.0100.04316.52
5.5.130.0120.04216.58
5.5.120.0090.03816.55
5.5.110.0100.02816.74
5.5.100.0110.04616.60
5.5.90.0100.04616.46
5.5.80.0120.04216.68
5.5.70.0080.04216.60
5.5.60.0070.04616.60
5.5.50.0070.04316.71
5.5.40.0100.04216.47
5.5.30.0110.04116.63
5.5.20.0160.03016.67
5.5.10.0120.04716.63
5.5.00.0040.02716.55
5.4.450.0110.04316.02
5.4.440.0080.02816.20
5.4.430.0130.04016.14
5.4.420.0090.03216.00
5.4.410.0080.04416.14
5.4.400.0170.03515.96
5.4.390.0100.03515.97
5.4.380.0070.03816.00
5.4.370.0050.04516.04
5.4.360.0110.03816.00
5.4.350.0120.03315.82
5.4.340.0120.04115.96
5.4.330.0110.00412.98
5.4.320.0090.04615.84
5.4.310.0070.04715.85
5.4.300.0120.01516.02
5.4.290.0120.03916.03
5.4.280.0140.04215.95
5.4.270.0050.04615.98
5.4.260.0030.04915.96
5.4.250.0090.02915.84
5.4.240.0090.02215.96
5.4.230.0080.04315.85
5.4.220.0100.04416.00
5.4.210.0050.03115.89
5.4.200.0090.02915.84
5.4.190.0050.02415.92
5.4.180.0120.04515.86
5.4.170.0060.02315.84
5.4.160.0060.02516.00
5.4.150.0100.03016.00
5.4.140.0140.03514.61
5.4.130.0140.03914.67
5.4.120.0080.02114.60
5.4.110.0080.02314.67
5.4.100.0090.03914.59
5.4.90.0030.02514.60
5.4.80.0100.03414.67
5.4.70.0120.03314.75
5.4.60.0020.02814.63
5.4.50.0090.02614.71
5.4.40.0130.03014.63
5.4.30.0110.02414.68
5.4.20.0150.03614.54
5.4.10.0130.03514.51
5.4.00.0150.03614.42
5.3.290.0100.07714.69
5.3.280.0170.07014.70
5.3.270.0000.04014.80
5.3.260.0200.05314.80
5.3.250.0070.05714.76
5.3.240.0070.07714.79
5.3.230.0030.07314.69
5.3.220.0000.08014.72
5.3.210.0070.04714.72
5.3.200.0100.07014.86
5.3.190.0070.07314.66
5.3.180.0000.04314.71
5.3.170.0070.03714.76
5.3.160.0130.07014.64
5.3.150.0170.03714.71
5.3.140.0100.05314.71
5.3.130.0170.07314.70
5.3.120.0030.04714.62
5.3.110.0000.05314.61
5.3.100.0070.05014.10
5.3.90.0170.06014.09
5.3.80.0100.07014.04
5.3.70.0100.07014.04
5.3.60.0100.03314.07
5.3.50.0070.07014.08
5.3.40.0170.06714.09
5.3.30.0070.06014.00
5.3.20.0100.07013.76
5.3.10.0100.04013.71
5.3.00.0100.06713.84
5.2.170.0130.05713.04
5.2.160.0100.05313.04
5.2.150.0130.05713.04
5.2.140.0100.05313.04
5.2.130.0030.06713.04
5.2.120.0100.03313.04
5.2.110.0000.07313.04
5.2.100.0130.05713.04
5.2.90.0100.06013.04
5.2.80.0100.05313.04
5.2.70.0030.06313.04
5.2.60.0200.03713.04
5.2.50.0130.03713.04
5.2.40.0130.05313.04
5.2.30.0070.03713.04
5.2.20.0070.04313.04
5.2.10.0100.05013.04
5.2.00.0100.06013.04
5.1.60.0070.02713.04
5.1.50.0130.04013.04
5.1.40.0130.04713.04
5.1.30.0130.05013.04
5.1.20.0070.04713.04
5.1.10.0130.05013.04
5.1.00.0030.03313.04
5.0.50.0100.04713.04
5.0.40.0070.02313.04
5.0.30.0000.03313.04
5.0.20.0070.04313.04
5.0.10.0070.01713.04
5.0.00.0000.03713.04
4.4.90.0100.03313.04
4.4.80.0130.03013.04
4.4.70.0130.03013.04
4.4.60.0070.03013.04
4.4.50.0030.03713.04
4.4.40.0070.05013.04
4.4.30.0030.03313.04
4.4.20.0130.02313.04
4.4.10.0070.01313.04
4.4.00.0030.05313.04
4.3.110.0070.02713.04
4.3.100.0070.02313.04
4.3.90.0030.01713.04
4.3.80.0070.04713.04
4.3.70.0070.03013.04
4.3.60.0070.02713.04
4.3.50.0070.01313.04
4.3.40.0030.02313.04
4.3.30.0030.01313.04
4.3.20.0070.03313.04
4.3.10.0030.01313.04
4.3.00.0030.01713.04

preferences:
51.06 ms | 401 KiB | 5 Q