3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = '<?xml version="1.0" encoding="utf-8"?><ResponseXML xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="GenericVO.CardEnquiry"><ReturnStatus>1</ReturnStatus><ReturnMessage>SUCCESS</ReturnMessage><RequestTime>20150430151542</RequestTime><ResponseTime>20150430151543</ResponseTime><CardInfo><CardNo>9999000000072720</CardNo><MemberID>2422732</MemberID><PrintedName>Xiaoheng Wang</PrintedName><MembershipTypeCode>MSR</MembershipTypeCode><MembershipStatusCode>ACTIVE</MembershipStatusCode><MembershipPhoto /><IssueDate>2015-03-26T00:00:00</IssueDate><EffectiveDate>2015-03-26T00:00:00</EffectiveDate><ExpiryDate>2016-03-26T00:00:00</ExpiryDate><Printed>false</Printed><PrintedDate xsi:nil="true" /><RenewedDate xsi:nil="true" /><tmpEffectiveDate xsi:nil="true" /><tmpExpiryDate xsi:nil="true" /><tmpMembershipStatusCode /><PointsBAL>5.0000</PointsBAL><TotalPointsBAL>5.0000</TotalPointsBAL><HoldingPoints>0</HoldingPoints><Remarks /><MembershipDiscount xsi:nil="true" /><TierCode>Welcome</TierCode><LoyaltyMessage>for-iCare-8898XXXXXXXXXXXX</LoyaltyMessage><DollarToPointsRatio /><RewardCycleLists><RewardCycleInfo Type="Current" Value="5.0000" ExpiringDate="2016-03-26T00:00:00" /></RewardCycleLists><IsSupplementary>false</IsSupplementary><isBurnSupplementaryCard>false</isBurnSupplementaryCard><RelationID>188559A7-9B25-486A-9989-4F9D1EFA5771</RelationID><PrimaryCardNo /><PrimaryRelationID /><PrimaryCardExpiryDate xsi:nil="true" /><PrimaryCardEffectiveDate xsi:nil="true" /><PtsHoldingDays>0</PtsHoldingDays><Passcode>75310179 </Passcode><StoredValueBalance>0.0000</StoredValueBalance><Currency /><LastVisitedDate>2015-04-26T00:00:00</LastVisitedDate><LastVisitedOutlet>518</LastVisitedOutlet><PointsToNextTier /><NettToNextTier /></CardInfo><MemberInfo><MemberID>2422732</MemberID><Salutation /><Name>Xiaoheng Wang</Name><NRIC /><Passport /><Email>wangxiaoheng0319@gmail.com</Email><Gender>F</Gender><DOB>1992-03-19T00:00:00</DOB><Nationality /><Block /><Level /><Unit /><Street /><Building /><PostalCode /><Country /><Address1> </Address1><Address2> </Address2><Address3> </Address3><ContactNo /><MobileNo>93585185</MobileNo><FaxNo /><ReferrerCode /><FacebookID /><FacebookName /><FacebookPhotoLink /><FacebookToken /><FacebookTokenExpiry /><FullPhotoName /><Base64PhotoString /><PhotoLink /></MemberInfo><MembershipInfo><TotalSpending>8.2</TotalSpending><TotalPoints>5</TotalPoints><TotalVisits>1</TotalVisits><LastVisitedOutletCode>518</LastVisitedOutletCode><MostCycleVisitedOutletCode>518</MostCycleVisitedOutletCode><TotalCycleVisits>1</TotalCycleVisits><TotalCycleSpending>8.2</TotalCycleSpending><TotalCyclePoints>5</TotalCyclePoints><TotalBalPoints>5</TotalBalPoints><CurrentMonthSpending>8.2</CurrentMonthSpending><CurrentMonth_1Spending>0</CurrentMonth_1Spending><CurrentMonth_2Spending>0</CurrentMonth_2Spending><TotalNettSpending>8.2</TotalNettSpending><TotalCycleNettSpending>8.2</TotalCycleNettSpending><CurrentMonthNettSpending>8.2</CurrentMonthNettSpending><CurrentMonth_1NettSpending>0</CurrentMonth_1NettSpending><CurrentMonth_2NettSpending>0</CurrentMonth_2NettSpending></MembershipInfo><TotalActiveVoucherCount>0</TotalActiveVoucherCount><VoucherLists /><ReceiptMessage>Card No : 9999000000072720 Tier : Welcome Stars Awarded: 0 Stars Balance: 5 Stored Value Balance: 0.0000 </ReceiptMessage></ResponseXML>'; $response = htmlspecialchars_decode($data); //echo $response;exit; $res = preg_replace('/xmlns[^=]*="[^"]*"/i', '', $response); // remove all namespaces $res = preg_replace('/xsi:nil="true"/i', '', $res); // remove all xsi:nil="true" $xml = simplexml_load_string($res); $xml->CardLists->children()->CardInfo;exit; $cardsArray = array(); $cardsStatus = array(); $counter = 0; foreach ($xml->CardLists->children()->CardInfo as $child) { // primary card, IsSupplementary == false if ($child->IsSupplementary == 'false') { $_SESSION['MainCard'] = (string) $child->CardNo; $_SESSION['TierCode'] = (string) $child->TierCode; $_SESSION["PointsTier"] = (string) $child->PointsToNextTier; $_SESSION["IssueDate"] = (string) $child->IssueDate; } else { //get supp cards if ($child->MembershipStatusCode == 'ACTIVE') { $cardsArray[$counter] = (string) $child->CardNo; $cardsStatus[$counter] = (string) $child->MembershipStatusCode; $counter++; } } }

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.0090.01217.00
8.3.50.0110.01022.19
8.3.40.0100.00719.09
8.3.30.0110.00419.52
8.3.20.0070.00020.69
8.3.10.0040.00422.29
8.3.00.0050.00319.75
8.2.180.0150.00018.91
8.2.170.0120.00322.96
8.2.160.0100.00320.69
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0090.00026.16
8.2.120.0040.00419.61
8.2.110.0030.00619.72
8.2.100.0080.00418.13
8.2.90.0080.00019.51
8.2.80.0030.00518.00
8.2.70.0000.00817.88
8.2.60.0060.00318.18
8.2.50.0060.00318.07
8.2.40.0030.00620.32
8.2.30.0040.00418.34
8.2.20.0000.00818.26
8.2.10.0050.00318.40
8.2.00.0000.00818.22
8.1.280.0110.00425.92
8.1.270.0090.00021.02
8.1.260.0070.00726.35
8.1.250.0110.00328.09
8.1.240.0030.00622.45
8.1.230.0000.01217.90
8.1.220.0080.00018.02
8.1.210.0060.00318.77
8.1.200.0030.00717.72
8.1.190.0040.00417.63
8.1.180.0000.00818.10
8.1.170.0050.00318.95
8.1.160.0040.00422.28
8.1.150.0040.00419.15
8.1.140.0040.00417.93
8.1.130.0070.00018.07
8.1.120.0030.00517.74
8.1.110.0030.00917.76
8.1.100.0000.00717.87
8.1.90.0040.00417.82
8.1.80.0040.00417.86
8.1.70.0030.00317.75
8.1.60.0030.00617.88
8.1.50.0000.00818.02
8.1.40.0030.00517.91
8.1.30.0060.00318.06
8.1.20.0000.00818.01
8.1.10.0030.00518.03
8.1.00.0040.00417.99
8.0.300.0000.00718.77
8.0.290.0080.00017.13
8.0.280.0040.00418.67
8.0.270.0030.00317.45
8.0.260.0000.00717.41
8.0.250.0040.00417.32
8.0.240.0000.00817.27
8.0.230.0030.00317.40
8.0.220.0000.00817.19
8.0.210.0040.00417.20
8.0.200.0000.00717.28
8.0.190.0000.00717.32
8.0.180.0070.00017.42
8.0.170.0060.00317.40
8.0.160.0000.00817.32
8.0.150.0040.00417.35
8.0.140.0000.00717.35
8.0.130.0080.00013.81
8.0.120.0080.00017.27
8.0.110.0040.00417.41
8.0.100.0000.00817.20
8.0.90.0040.00417.35
8.0.80.0080.00817.31
8.0.70.0040.00417.26
8.0.60.0060.00317.41
8.0.50.0070.00017.30
8.0.30.0160.00917.52
8.0.20.0130.02117.47
8.0.10.0080.00017.42
8.0.00.0090.01017.24
7.4.330.0030.00315.34
7.4.320.0070.00017.17
7.4.300.0000.00717.05
7.4.290.0100.00017.16
7.4.280.0070.00016.97
7.4.270.0050.00216.95
7.4.260.0050.00317.08
7.4.250.0000.00816.98
7.4.240.0030.00517.02
7.4.230.0000.00717.02
7.4.220.0120.00617.09
7.4.210.0110.00617.18
7.4.200.0000.00717.07
7.4.160.0060.00916.77
7.4.150.0090.01217.40
7.4.140.0140.00817.86
7.4.130.0080.01016.96
7.4.120.0100.00716.95
7.4.110.0100.01716.87
7.4.100.0120.00916.98
7.4.90.0140.00316.95
7.4.80.0140.00419.39
7.4.70.0070.01616.99
7.4.60.0030.01317.09
7.4.50.0000.00616.89
7.4.40.0110.00616.81
7.4.30.0090.00917.09
7.4.00.0060.01315.17
7.3.330.0060.00013.34
7.3.320.0150.00013.52
7.3.310.0040.00416.48
7.3.300.0040.00416.66
7.3.290.0000.00716.64
7.3.280.0030.01316.63
7.3.270.0280.01617.40
7.3.260.0070.01016.89
7.3.250.0110.00616.87
7.3.240.0140.00316.89
7.3.230.0090.00916.84
7.3.210.0150.00416.64
7.3.200.0200.00319.39
7.3.190.0160.00616.82
7.3.180.0040.01216.69
7.3.170.0070.01716.67
7.3.160.0120.00616.74
7.3.120.0080.00814.94
7.3.110.0130.00615.25
7.3.100.0040.00915.21
7.3.90.0100.00214.97
7.3.80.0030.00815.21
7.3.70.0080.00315.09
7.3.60.0040.00415.15
7.3.50.0050.00915.10
7.3.40.0070.00715.05
7.3.30.0050.00815.01
7.3.20.0070.00716.92
7.3.10.0030.01016.86
7.3.00.0050.00516.80
7.2.330.0040.01517.02
7.2.320.0110.00716.84
7.2.310.0060.01616.74
7.2.300.0110.01117.05
7.2.290.0060.01216.77
7.2.250.0070.01315.37
7.2.240.0050.01115.10
7.2.230.0040.01415.21
7.2.220.0090.00415.14
7.2.210.0070.00815.26
7.2.200.0090.00515.28
7.2.190.0010.01015.43
7.2.180.0030.00915.29
7.2.170.0090.00415.14
7.2.00.0080.00819.84
7.1.330.0070.00916.26
7.1.320.0040.00816.08
7.1.310.0060.00816.11
7.1.300.0030.00815.95
7.1.290.0080.00616.03
7.1.280.0050.00816.05
7.1.270.0030.00916.03
7.1.260.0050.00916.30
7.1.100.0030.00718.33
7.1.70.0030.01017.59
7.1.60.0150.00919.50
7.1.50.0100.01617.19
7.1.00.0100.07022.63
7.0.200.0210.00416.95
7.0.140.0000.04722.20
7.0.60.0070.08019.96
7.0.50.0130.08018.01
7.0.40.0030.05020.48
7.0.30.0570.05020.29
7.0.20.0370.07020.34
7.0.10.0270.08020.29
7.0.00.0100.06020.45
5.6.280.0030.07021.18
5.6.210.0030.07020.88
5.6.200.0100.05318.31
5.6.190.0170.07320.82
5.6.180.0400.06020.59
5.6.170.0370.06020.64
5.6.160.0170.07320.70
5.6.150.0070.08018.27
5.6.140.0030.08318.34
5.6.130.0100.07318.30
5.6.120.0070.08721.10
5.6.110.0100.06721.10
5.6.100.0130.07721.10
5.6.90.0170.07721.02
5.6.80.0170.07320.48
5.6.70.0370.06720.64
5.5.350.0170.04720.52
5.5.340.0030.08018.07
5.5.330.0070.06320.70
5.5.320.0100.03720.20
5.5.310.0330.06020.31
5.5.300.0170.07018.09
5.5.290.0100.08318.04
5.5.280.0170.07321.04
5.5.270.0030.09321.07
5.5.260.0170.07721.08
5.5.250.0030.09020.86
5.5.240.0100.07020.31
5.4.450.0600.06319.74
5.4.440.0730.05319.59
5.4.430.0100.05319.32
5.4.420.0200.07019.63
5.4.410.0130.05719.26
5.4.400.0370.05318.89
5.4.390.0300.05718.96
5.4.380.0370.05318.73
5.4.370.0370.05018.64
5.4.360.0400.05018.86
5.4.350.0300.06018.80
5.4.340.0270.05318.83
5.4.320.0230.06318.73
5.4.310.0330.05318.83
5.4.300.0370.05018.64
5.4.290.0270.05718.83
5.4.280.0270.06318.94
5.4.270.0330.05018.82
5.4.260.0230.06018.83
5.4.250.0370.05318.77
5.4.240.0300.06018.64
5.4.230.0400.04718.82
5.4.220.0370.05018.78
5.4.210.0230.06318.84
5.4.200.0300.05316.54
5.4.190.0300.05018.63
5.4.180.0370.04718.62
5.4.170.0300.06718.75
5.4.160.0430.04318.83
5.4.150.0330.05018.81
5.4.140.0330.05016.20
5.4.130.0370.04716.30
5.4.120.0300.05316.30
5.4.110.0200.05316.22
5.4.100.0230.06716.30
5.4.90.0330.07016.41
5.4.80.0330.06316.16
5.4.70.0430.04716.43
5.4.60.0430.06316.41
5.4.50.0370.06716.44
5.4.40.0400.06316.14
5.4.30.0570.04016.41
5.4.20.0270.06016.16
5.4.10.0330.04716.25
5.4.00.0300.05315.92
5.3.290.0300.05014.85
5.3.280.0230.06014.79
5.3.270.0370.05714.81
5.3.260.0330.05014.90
5.3.250.0370.05314.74
5.3.240.0300.05014.86
5.3.230.0370.05014.74
5.3.220.0370.04714.68
5.3.210.0330.05314.86
5.3.200.0270.05314.85
5.3.190.0270.06014.64
5.3.180.0370.05014.70
5.3.170.0400.04014.85
5.3.160.0300.06314.75
5.3.150.0330.05314.84
5.3.140.0430.06714.85
5.3.130.0330.05014.79
5.3.120.0270.06014.63
5.3.110.0330.05314.73
5.3.100.0330.05714.31
5.3.90.0400.05314.26
5.3.80.0370.04314.30
5.3.70.0270.06014.13
5.3.60.0300.05014.30
5.3.50.0230.05714.13
5.3.40.0430.05314.18
5.3.30.0400.04014.09
5.3.20.0430.04713.76
5.3.10.0330.05313.73
5.3.00.0400.04013.78
5.2.170.0270.04011.33
5.2.160.0300.03311.25
5.2.150.0300.03711.45
5.2.140.0230.04311.23
5.2.130.0230.05311.28
5.2.120.0270.04011.22
5.2.110.0270.03711.37
5.2.100.0270.03711.29
5.2.90.0300.04011.25
5.2.80.0230.04311.24
5.2.70.0270.04011.18
5.2.60.0330.03011.29
5.2.50.0170.04711.10
5.2.40.0230.04011.08
5.2.30.0170.04311.34
5.2.20.0230.04011.10
5.2.10.0200.04011.00
5.2.00.0230.04310.98
5.1.60.0200.04010.15
5.1.50.0130.04010.25
5.1.40.0170.04010.18
5.1.30.0170.04010.66
5.1.20.0070.05010.57
5.1.10.0230.04010.19
5.1.00.0200.03710.32
5.0.50.0100.0308.59
5.0.40.0200.0278.47
5.0.30.0130.0478.38
5.0.20.0070.0308.33
5.0.10.0100.0308.26
5.0.00.0170.0378.25
4.4.90.0130.0206.58
4.4.80.0070.0276.58
4.4.70.0200.0176.58
4.4.60.0130.0206.58
4.4.50.0070.0236.58
4.4.40.0100.0336.58
4.4.30.0170.0176.58
4.4.20.0130.0276.58
4.4.10.0170.0176.58
4.4.00.0100.0376.58
4.3.110.0100.0236.58
4.3.100.0100.0206.58
4.3.90.0130.0206.58
4.3.80.0200.0276.58
4.3.70.0100.0236.58
4.3.60.0130.0206.58
4.3.50.0100.0236.58
4.3.40.0070.0376.58
4.3.30.0000.0306.58
4.3.20.0070.0206.58
4.3.10.0070.0236.58
4.3.00.0100.0206.68

preferences:
50.56 ms | 401 KiB | 5 Q