3v4l.org

run code in 300+ PHP versions simultaneously
<?php $response = '<ItemTaxWithheldList> <TaxWithheldComponent> <TaxesWithheld> <ChargeComponent> <ChargeType>MarketplaceFacilitatorTax-Shipping</ChargeType> <ChargeAmount> <CurrencyAmount>-5.54</CurrencyAmount> </ChargeAmount> </ChargeComponent> <ChargeComponent> <ChargeType>MarketplaceFacilitatorTax-Principal</ChargeType> <ChargeAmount> <CurrencyAmount>-10.87</CurrencyAmount> </ChargeAmount> </ChargeComponent> </TaxesWithheld> </TaxWithheldComponent> <TaxWithheldComponent> <TaxesWithheld> <ChargeComponent> <ChargeType>MarketplaceFacilitatorTax-Other</ChargeType> <ChargeAmount> <CurrencyAmount>-0.27</CurrencyAmount> </ChargeAmount> </ChargeComponent> <ChargeComponent> <ChargeType>MarketplaceFacilitatorTax-Shipping</ChargeType> <ChargeAmount> <CurrencyAmount>0.0</CurrencyAmount> </ChargeAmount> </ChargeComponent> <ChargeComponent> <ChargeType>MarketplaceFacilitatorTax-Principal</ChargeType> <ChargeAmount> <CurrencyAmount>0.0</CurrencyAmount> </ChargeAmount> </ChargeComponent> </TaxesWithheld> </TaxWithheldComponent> <TaxWithheldComponent> <TaxesWithheld> <ChargeComponent> <ChargeType>MarketplaceFacilitatorTax-Shipping</ChargeType> <ChargeAmount> <CurrencyAmount>0.0</CurrencyAmount> </ChargeAmount> </ChargeComponent> <ChargeComponent> <ChargeType>MarketplaceFacilitatorTax-Principal</ChargeType> <ChargeAmount> <CurrencyAmount>-4.87</CurrencyAmount> </ChargeAmount> </ChargeComponent> </TaxesWithheld> </TaxWithheldComponent> </ItemTaxWithheldList>'; $return_data = simplexml_load_string($response); $array = json_decode(json_encode((array)$return_data), TRUE); $chargeTypes = array('MarketplaceFacilitatorTax-Other', 'MarketplaceFacilitatorTax-Shipping', 'MarketplaceFacilitatorTax-Principal'); foreach ($array['TaxWithheldComponent'] as $itemTaxWithheldList) { $charges = array(); foreach ($itemTaxWithheldList['TaxesWithheld']['ChargeComponent'] as $key) { $mpftChargeType = $key['ChargeType']; $mpftChargeAmount = number_format((float)$key['ChargeAmount']['CurrencyAmount'], 2, '.', ''); $charges[$mpftChargeType] = $mpftChargeAmount; } echo '<tr>'; foreach ($chargeTypes as $chargeType) { echo '<td>' . ($charges[$chargeType] ?? '0.00') . '</td>'; } echo '</tr>'; }

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.4.120.0120.00820.87
8.4.110.0090.01022.73
8.4.100.0130.00617.95
8.4.90.0140.00720.57
8.4.80.0080.00819.00
8.4.70.0130.00620.70
8.4.60.0090.00821.09
8.4.50.0130.00718.68
8.4.40.0130.00718.13
8.4.30.0050.00322.79
8.4.20.0130.00717.71
8.4.10.0100.01019.88
8.3.250.0110.00919.20
8.3.240.0110.00817.20
8.3.230.0100.00916.69
8.3.220.0120.00619.30
8.3.210.0090.00416.77
8.3.200.0050.00416.75
8.3.190.0080.01119.20
8.3.180.0080.01019.06
8.3.170.0110.00717.16
8.3.160.0050.01517.04
8.3.150.0070.01016.80
8.3.140.0150.00416.81
8.3.130.0040.00718.54
8.3.120.0060.00320.95
8.3.110.0060.00920.94
8.3.100.0060.00324.06
8.3.90.0040.00426.77
8.3.80.0090.00016.95
8.3.70.0120.00316.75
8.3.60.0140.00716.88
8.3.50.0120.00824.56
8.3.40.0040.01122.15
8.3.30.0040.01118.96
8.3.20.0040.00424.18
8.3.10.0040.00424.66
8.3.00.0030.00626.16
8.2.290.0150.00417.72
8.2.280.0090.01020.09
8.2.270.0060.00916.73
8.2.260.0030.01217.33
8.2.250.0060.00317.13
8.2.240.0050.00317.59
8.2.230.0120.00322.58
8.2.220.0140.00037.54
8.2.210.0150.00026.77
8.2.200.0030.00616.88
8.2.190.0090.00616.58
8.2.180.0070.01325.92
8.2.170.0140.00719.23
8.2.160.0070.00722.96
8.2.150.0080.00025.66
8.2.140.0050.00224.66
8.2.130.0050.00326.16
8.2.120.0040.00426.35
8.2.110.0070.00320.72
8.2.100.0040.00718.16
8.2.90.0000.00818.22
8.2.80.0000.00817.97
8.2.70.0080.00417.75
8.2.60.0030.00518.41
8.2.50.0040.00418.05
8.2.40.0040.00420.25
8.2.30.0000.00818.42
8.2.20.0040.00418.27
8.2.10.0050.00319.67
8.2.00.0040.00419.70
8.1.330.0110.00822.42
8.1.320.0080.00918.09
8.1.310.0110.00716.48
8.1.300.0040.00416.26
8.1.290.0030.00630.84
8.1.280.0070.01125.92
8.1.270.0040.00423.99
8.1.260.0060.00328.09
8.1.250.0060.00628.09
8.1.240.0050.00522.67
8.1.230.0040.00822.92
8.1.220.0000.00817.89
8.1.210.0000.00818.97
8.1.200.0030.00717.61
8.1.190.0000.00917.61
8.1.180.0030.00618.10
8.1.170.0040.00419.13
8.1.160.0060.00319.13
8.1.150.0000.00719.23
8.1.140.0000.00719.18
8.1.130.0030.00520.45
8.1.120.0080.00017.69
8.1.110.0000.00917.61
8.1.100.0040.00417.64
8.1.90.0040.00417.64
8.1.80.0000.00917.65
8.1.70.0040.00417.73
8.1.60.0060.00317.82
8.1.50.0100.00017.68
8.1.40.0040.00417.80
8.1.30.0040.00417.92
8.1.20.0050.00317.80
8.1.10.0040.00417.87
8.1.00.0030.00617.78
8.0.300.0040.00420.11
8.0.290.0050.00317.00
8.0.280.0030.00318.63
8.0.270.0050.00318.23
8.0.260.0000.00618.75
8.0.250.0030.00317.17
8.0.240.0000.00717.24
8.0.230.0080.00017.23
8.0.220.0030.00617.19
8.0.210.0000.00717.07
8.0.200.0030.00617.16
8.0.190.0000.00717.20
8.0.180.0040.00417.19
8.0.170.0000.00917.20
8.0.160.0000.00717.20
8.0.150.0040.00417.00
8.0.140.0120.00017.09
8.0.130.0030.00313.53
8.0.120.0020.00517.04
8.0.110.0080.00017.00
8.0.100.0050.00217.18
8.0.90.0040.00416.98
8.0.80.0050.01417.08
8.0.70.0070.00017.28
8.0.60.0040.00417.05
8.0.50.0030.00617.18
8.0.30.0080.00817.66
8.0.20.0100.01017.24
8.0.10.0080.00017.16
8.0.00.0130.01017.03
7.4.330.0000.00515.55
7.4.320.0030.00316.84
7.4.300.0060.00016.75
7.4.290.0040.00416.77
7.4.280.0070.00016.79
7.4.270.0000.00716.75
7.4.260.0050.00013.44
7.4.250.0030.00316.76
7.4.240.0050.00216.73
7.4.230.0080.00016.52
7.4.220.0040.00416.94
7.4.210.0020.01316.84
7.4.200.0000.00716.75
7.4.130.0130.01016.89
7.4.120.0110.00816.74
7.4.110.0150.00416.82
7.4.100.0100.01416.80
7.4.90.0160.01816.70
7.4.80.0180.01316.66
7.4.70.0140.01316.48
7.4.60.0140.01316.85
7.4.50.0150.01516.77
7.4.40.0090.01116.60
7.4.30.0210.01516.77
7.4.20.0050.01316.84
7.4.10.0110.00916.72
7.4.00.0150.00616.82
7.3.330.0070.00016.63
7.3.320.0000.00713.37
7.3.310.0070.00016.75
7.3.300.0050.00316.69
7.3.290.0090.00516.66
7.3.260.0140.00316.71
7.3.250.0100.01016.79
7.3.240.0100.01016.88
7.3.230.0150.00716.81
7.3.220.0160.01016.96
7.3.210.0140.01216.83
7.3.200.0130.01316.73
7.3.190.0170.01916.89
7.3.180.0090.01316.65
7.3.170.0140.01216.89
7.3.160.0150.00516.78
7.3.150.0100.01216.69
7.3.140.0100.01316.51
7.3.130.0080.01216.75
7.3.120.0130.00816.89
7.3.110.0150.00316.66
7.3.100.0110.00816.70
7.3.90.0130.00816.72
7.3.80.0100.01016.69
7.3.70.0070.01016.75
7.3.60.0160.00516.77
7.3.50.0090.01316.71
7.3.40.0120.01016.73
7.3.30.0100.01116.70
7.3.20.0120.00916.75
7.3.10.0100.01316.65
7.3.00.0090.01016.69
7.2.340.0150.00916.82
7.2.330.0090.02716.82
7.2.320.0130.01017.00
7.2.310.0070.02417.15
7.2.300.0090.01216.93
7.2.290.0040.02217.01
7.2.280.0100.01717.12
7.2.270.0040.02116.89
7.2.260.0350.03016.87
7.2.250.0100.01417.01
7.2.240.0120.01216.84
7.2.230.0130.00617.04
7.2.220.0030.01717.02
7.2.210.0180.00916.95
7.2.200.0150.00916.88
7.2.190.0100.01317.05
7.2.180.0090.00917.15
7.2.170.0140.01417.04
7.2.160.0150.00417.00
7.2.150.0100.01417.09
7.2.140.0070.01117.04
7.2.130.0200.00716.99
7.2.120.0070.01417.04
7.2.110.0040.01617.06
7.2.100.0130.01316.95
7.2.90.0130.00616.89
7.2.80.0080.01216.95
7.2.70.0100.01717.14
7.2.60.0100.01716.91
7.2.50.0090.01216.98
7.2.40.0130.00717.17
7.2.30.0320.01317.01
7.2.20.0150.00817.06
7.2.10.0060.01317.11
7.2.00.0060.01517.00
7.1.330.0250.01116.18
7.1.320.0480.01915.96
7.1.310.0170.01716.03
7.1.300.0240.00715.79
7.1.290.0310.00516.03
7.1.280.0250.00615.96
7.1.270.0320.00416.04
7.1.260.0450.02115.89
7.1.250.0210.01315.96
7.1.240.0570.00316.00
7.1.230.0280.00815.91
7.1.220.0260.00915.89
7.1.210.0240.00515.89
7.1.200.0190.01116.00
7.1.190.0540.00615.93
7.1.180.0320.00715.89
7.1.170.0290.00515.84
7.1.160.0180.01515.96
7.1.150.0220.00515.73
7.1.140.0230.00615.92
7.1.130.0270.00315.77
7.1.120.0290.00315.81
7.1.110.0260.00615.97
7.1.100.0200.01215.98
7.1.90.0550.00615.82
7.1.80.0250.00515.91
7.1.70.0260.00416.05
7.1.60.0220.01115.94
7.1.50.0170.01415.94
7.1.40.0290.00715.86
7.1.30.0210.00715.89
7.1.20.0180.01515.83
7.1.10.0220.00816.06
7.1.00.0200.01015.82
7.0.330.0180.01215.64
7.0.320.0210.00915.63
7.0.310.0210.01415.52
7.0.300.0250.00915.60
7.0.290.0210.01015.54
7.0.280.0210.00815.59
7.0.270.0260.00415.41
7.0.260.0290.00415.62
7.0.250.0230.00915.72
7.0.240.0250.00415.62
7.0.230.0250.00615.76
7.0.220.0210.00815.60
7.0.210.0480.00615.75
7.0.200.0140.01415.63
7.0.190.0220.00715.64
7.0.180.0150.01915.70
7.0.170.0280.00315.68
7.0.160.0220.00615.67
7.0.150.0250.00315.48
7.0.140.0210.00715.56
7.0.130.0270.00315.53
7.0.120.0200.00915.73
7.0.110.0250.00715.63
7.0.100.0140.01515.46
7.0.90.0190.00615.62
7.0.80.0270.00415.63
7.0.70.0370.00715.63
7.0.60.0190.01115.66
7.0.50.0230.00515.59
7.0.40.0260.01015.55
7.0.30.0210.00915.50
7.0.20.0220.01315.67
7.0.10.0200.00715.52
7.0.00.0170.00915.52
5.6.400.0160.01015.50
5.6.390.0240.00915.73
5.6.380.0300.00315.70
5.6.370.0180.01815.39
5.6.360.0120.01815.53
5.6.350.0210.01015.79
5.6.340.0270.00415.62
5.6.330.0220.01515.88
5.6.320.0230.00715.74
5.6.310.0280.00615.51
5.6.300.0120.01815.77
5.6.290.0220.00715.88
5.6.280.0200.01015.58
5.6.270.0200.01015.70
5.6.260.0240.01415.74
5.6.250.0070.02415.86
5.6.240.0240.00715.66
5.6.230.0180.01115.77
5.6.220.0230.01115.48
5.6.210.0360.02015.66
5.6.200.0140.01415.70
5.6.190.0230.00815.71
5.6.180.0160.01415.82
5.6.170.0170.01215.63
5.6.160.0220.01015.59
5.6.150.0210.01415.72
5.6.140.0220.00915.55
5.6.130.0230.00715.52
5.6.120.0230.01015.77
5.6.110.0190.01215.58
5.6.100.0260.00315.55
5.6.90.0260.00415.89
5.6.80.0180.01515.45
5.6.70.0200.00815.57
5.6.60.0160.01215.65
5.6.50.0190.01015.61
5.6.40.0210.00715.58
5.6.30.0170.01115.46
5.6.20.0140.01415.60
5.6.10.0160.01415.43
5.6.00.0220.01115.64
5.5.380.0280.00615.61
5.5.370.0180.01215.58
5.5.360.0190.00815.59
5.5.350.0260.00415.55
5.5.340.0250.01015.63
5.5.330.0190.01115.56
5.5.320.0150.01515.39
5.5.310.0220.00715.87
5.5.300.0240.00715.54
5.5.290.0210.01115.43
5.5.280.0160.01515.58
5.5.270.0220.00915.47
5.5.260.0140.01615.73
5.5.250.0180.01215.68
5.5.240.0190.01415.43
5.5.230.0200.01115.67
5.5.220.0170.01215.57
5.5.210.0170.01415.52
5.5.200.0300.00015.46
5.5.190.0180.01515.80
5.5.180.0200.01015.43
5.5.170.0240.00815.30
5.5.160.0220.00615.47
5.5.150.0130.01715.49
5.5.140.0190.01315.48
5.5.130.0290.00015.48
5.5.120.0180.01015.59
5.5.110.0240.00515.70
5.5.100.0210.00915.55
5.5.90.0050.02315.52
5.5.80.0140.01115.53
5.5.70.0080.01215.43
5.5.60.0140.01115.19
5.5.50.0140.00915.46
5.5.40.0130.01015.73
5.5.30.0140.01115.56
5.5.20.0080.01415.45
5.5.10.0160.00715.60
5.5.00.0150.00915.62
5.4.450.0120.01212.50
5.4.440.0170.00712.32
5.4.430.0160.00712.37
5.4.420.0150.01212.48
5.4.410.0110.01112.51
5.4.400.0170.00612.50
5.4.390.0130.01012.40
5.4.380.0180.00612.21
5.4.370.0180.00512.29
5.4.360.0190.00412.58
5.4.350.0200.00312.23
5.4.340.0130.01012.46
5.4.330.0040.01812.11
5.4.320.0120.00912.23
5.4.310.0180.00412.52
5.4.300.0200.00312.46
5.4.290.0170.00612.22
5.4.280.0150.00912.32
5.4.270.0130.01012.18
5.4.260.0190.00312.49
5.4.250.0150.00012.24
5.4.240.0130.00312.14
5.4.230.0190.01912.33
5.4.220.0130.00312.34
5.4.210.0120.00612.41
5.4.200.0070.01012.49
5.4.190.0120.00512.37
5.4.180.0090.00912.66
5.4.170.0080.00812.20
5.4.160.0030.01312.27
5.4.150.0080.01212.34
5.4.140.0090.00912.32
5.4.130.0130.00712.32
5.4.120.0070.01012.36
5.4.110.0080.00812.30
5.4.100.0070.01112.37
5.4.90.0140.00412.45
5.4.80.0110.01112.41
5.4.70.0180.00612.43
5.4.60.0140.00812.43
5.4.50.0130.00712.31
5.4.40.0130.00912.49
5.4.30.0160.00512.48
5.4.20.0040.01812.50
5.4.10.0070.00712.35
5.4.00.0110.00612.39
5.3.290.0200.00412.92
5.3.280.0170.00712.59
5.3.270.0110.01512.75
5.3.260.0130.01012.84
5.3.250.0150.01112.66
5.3.240.0120.01212.53
5.3.230.0180.00612.62
5.3.220.0120.01012.55
5.3.210.0210.00312.76
5.3.200.0170.00812.73
5.3.190.0200.00812.68
5.3.180.0230.00313.04
5.3.170.0150.00713.08
5.3.160.0180.01112.93
5.3.150.0150.01212.78
5.3.140.0170.00812.78
5.3.130.0230.00412.81
5.3.120.0110.01413.00
5.3.110.0180.00512.76
5.3.100.0160.00612.67
5.3.90.0190.00312.73
5.3.80.0200.00312.78
5.3.70.0140.00712.78
5.3.60.0140.00712.72
5.3.50.0170.00412.67
5.3.40.0120.00912.73
5.3.30.0150.01112.73
5.3.20.0190.00512.61
5.3.10.0110.01112.44
5.3.00.0110.01112.46
5.2.170.0170.00011.87
5.2.160.0090.00911.78
5.2.150.0090.00911.89
5.2.140.0050.01911.71
5.2.130.0080.01511.72
5.2.120.0090.00911.96
5.2.110.0110.01211.68
5.2.100.0100.01311.72
5.2.90.0140.00711.72
5.2.80.0160.00311.73
5.2.70.0120.01211.89
5.2.60.0140.00611.59
5.2.50.0140.00711.85
5.2.40.0170.00311.75
5.2.30.0110.00811.59
5.2.20.0080.01411.50
5.2.10.0100.00811.45
5.2.00.0100.01011.48
5.1.60.0120.00911.28
5.1.50.0130.00511.28
5.1.40.0160.00511.28
5.1.30.0080.00811.28
5.1.20.0130.00811.28
5.1.10.0100.00711.28
5.1.00.0100.00611.28
5.0.50.0070.00711.28
5.0.40.0110.00311.28
5.0.30.0050.01011.28
5.0.20.0100.00711.28
5.0.10.0090.00611.28
5.0.00.0110.00811.28
4.4.90.0060.00311.28
4.4.80.0060.00311.28
4.4.70.0090.00011.28
4.4.60.0070.00211.28
4.4.50.0000.00911.28
4.4.40.0000.00811.28
4.4.30.0090.00011.28
4.4.20.0070.00411.28
4.4.10.0060.00311.28
4.4.00.0050.00311.28
4.3.110.0080.00011.28
4.3.100.0070.00411.28
4.3.90.0120.00011.28
4.3.80.0060.00311.28
4.3.70.0090.00011.28
4.3.60.0050.00511.28
4.3.50.0070.00211.28
4.3.40.0080.00011.28
4.3.30.0040.00411.28
4.3.20.0080.00011.28
4.3.10.0060.00311.28
4.3.00.0050.00211.28

preferences:
151.96 ms | 403 KiB | 5 Q