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); $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; echo $child;exit; } 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.0140.00318.80
8.3.50.0090.00918.48
8.3.40.0100.01319.21
8.3.30.0070.01119.25
8.3.20.0040.00420.61
8.3.10.0040.00422.01
8.3.00.0080.00019.48
8.2.180.0000.01518.79
8.2.170.0080.00822.96
8.2.160.0000.01420.76
8.2.150.0040.00425.66
8.2.140.0050.00324.66
8.2.130.0060.00326.16
8.2.120.0050.00319.86
8.2.110.0030.00622.50
8.2.100.0090.00318.16
8.2.90.0000.01019.46
8.2.80.0080.00018.13
8.2.70.0040.00418.13
8.2.60.0030.00518.41
8.2.50.0050.00318.25
8.2.40.0000.00820.26
8.2.30.0050.00318.33
8.2.20.0000.00818.06
8.2.10.0050.00318.32
8.2.00.0050.00218.09
8.1.280.0120.00325.92
8.1.270.0120.00622.38
8.1.260.0040.00426.35
8.1.250.0000.00728.09
8.1.240.0060.00322.85
8.1.230.0060.00618.20
8.1.220.0000.00818.01
8.1.210.0040.00418.77
8.1.200.0060.00317.50
8.1.190.0000.00817.73
8.1.180.0080.00018.10
8.1.170.0000.00818.97
8.1.160.0070.00022.27
8.1.150.0000.00719.19
8.1.140.0030.00517.83
8.1.130.0030.00517.84
8.1.120.0020.00517.77
8.1.110.0030.00717.96
8.1.100.0040.00417.84
8.1.90.0040.00417.93
8.1.80.0050.00217.93
8.1.70.0030.00317.74
8.1.60.0030.00717.90
8.1.50.0040.00417.86
8.1.40.0000.00818.03
8.1.30.0060.00317.92
8.1.20.0040.00418.16
8.1.10.0000.00918.06
8.1.00.0050.00317.81
8.0.300.0050.00218.77
8.0.290.0000.00717.25
8.0.280.0000.00718.70
8.0.270.0040.00417.55
8.0.260.0000.00717.34
8.0.250.0040.00317.44
8.0.240.0080.00017.48
8.0.230.0040.00417.29
8.0.220.0070.00017.43
8.0.210.0070.00017.46
8.0.200.0030.00317.45
8.0.190.0030.00517.44
8.0.180.0000.00717.50
8.0.170.0060.00317.47
8.0.160.0040.00417.27
8.0.150.0000.00717.24
8.0.140.0060.00317.32
8.0.130.0020.00513.84
8.0.120.0000.00817.27
8.0.110.0040.00417.46
8.0.100.0050.00217.32
8.0.90.0000.00717.50
8.0.80.0110.00717.30
8.0.70.0000.00717.31
8.0.60.0040.00417.31
8.0.50.0050.00317.40
8.0.30.0170.00917.52
8.0.20.0200.00417.61
8.0.10.0000.00817.60
8.0.00.0140.00517.42
7.4.330.0000.00515.34
7.4.320.0040.00417.00
7.4.300.0030.00316.97
7.4.290.0030.00716.88
7.4.280.0030.00517.11
7.4.270.0070.00017.01
7.4.260.0000.00816.99
7.4.250.0000.00817.06
7.4.240.0060.00217.04
7.4.230.0050.00216.77
7.4.220.0140.00517.18
7.4.210.0090.00817.10
7.4.200.0000.00717.20
7.4.160.0100.00717.03
7.4.150.0070.01117.40
7.4.140.0090.00917.86
7.4.130.0040.01516.98
7.4.120.0100.00817.02
7.4.110.0060.01916.92
7.4.100.0090.01317.05
7.4.90.0080.01117.07
7.4.80.0110.00719.39
7.4.70.0110.00817.00
7.4.60.0030.01417.11
7.4.50.0000.00516.79
7.4.40.0100.00617.12
7.4.30.0070.01017.07
7.4.00.0070.01115.20
7.3.330.0030.00313.48
7.3.320.0070.00713.45
7.3.310.0030.00316.61
7.3.300.0030.00316.64
7.3.290.0030.00316.66
7.3.280.0080.00916.63
7.3.270.0090.00917.40
7.3.260.0110.00616.69
7.3.250.0140.01016.72
7.3.240.0120.00316.91
7.3.230.0170.00716.86
7.3.210.0100.01116.92
7.3.200.0030.01819.39
7.3.190.0160.00616.80
7.3.180.0040.01116.82
7.3.170.0110.00716.77
7.3.160.0100.01416.77
7.2.330.0050.01516.94
7.2.320.0110.00616.97
7.2.310.0090.01416.95
7.2.300.0060.01217.00
7.2.290.0120.00917.14
7.2.00.0070.00719.70
7.1.100.0050.00918.36
7.1.70.0060.00317.64
7.1.60.0000.02519.50
7.1.50.0100.01617.45
7.1.00.0000.08022.56
7.0.200.0230.00716.75
7.0.140.0030.07322.25
7.0.60.0230.06720.19
7.0.50.0130.07717.89
7.0.40.0100.08020.42
7.0.30.0270.03720.45
7.0.20.0270.04020.44
7.0.10.0370.07720.18
7.0.00.0070.04320.23
5.6.280.0100.06320.95
5.6.210.0070.08020.77
5.6.200.0070.05318.34
5.6.190.0070.09020.52
5.6.180.0270.04320.84
5.6.170.0500.07320.71
5.6.160.0070.04320.52
5.6.150.0070.07718.31
5.6.140.0130.07718.23
5.6.130.0130.08018.36
5.6.120.0130.04721.10
5.6.110.0130.05321.26
5.6.100.0030.04021.22
5.6.90.0100.08021.09
5.6.80.0070.08020.50
5.6.70.4300.03720.48
5.5.350.0200.08320.62
5.5.340.0030.05018.09
5.5.330.0170.05020.39
5.5.320.0070.06320.69
5.5.310.0400.06020.53
5.5.300.0100.08018.03
5.5.290.0030.08718.04
5.5.280.0170.07720.99
5.5.270.0070.05720.82
5.5.260.0070.09020.98
5.5.250.0030.06020.71
5.5.240.0030.07320.45
5.4.450.0730.05019.56
5.4.440.1230.06019.67
5.4.430.0270.05019.70
5.4.420.0770.05719.71
5.4.410.0930.04319.62
5.4.400.0370.07318.93
5.4.390.0330.05018.75
5.4.380.0300.05318.61
5.4.370.0200.06018.86
5.4.360.0400.04018.65
5.4.350.0230.06018.77
5.4.340.0330.05718.83
5.4.320.0270.05718.79
5.4.310.0270.05318.85
5.4.300.0330.05718.86
5.4.290.0300.05318.81
5.4.280.0370.04718.92
5.4.270.0270.05318.61
5.4.260.0330.05018.83
5.4.250.0300.05318.89
5.4.240.0470.06718.67
5.4.230.0300.05718.71
5.4.220.0370.05018.66
5.4.210.0270.05318.80
5.4.200.0230.05316.76
5.4.190.0230.05318.73
5.4.180.0370.05018.82
5.4.170.0370.05318.79
5.4.160.0270.05318.72
5.4.150.0300.05018.70
5.4.140.0400.04016.46
5.4.130.0230.05316.43
5.4.120.0330.04716.46
5.4.110.0300.05016.20
5.4.100.0430.05316.34
5.4.90.0370.06316.45
5.4.80.0230.05716.43
5.4.70.0300.05016.28
5.4.60.0230.05016.27
5.4.50.0300.05016.42
5.4.40.0370.05316.43
5.4.30.0330.04716.40
5.4.20.0300.05316.25
5.4.10.0330.04716.42
5.4.00.0130.06015.73
5.3.290.0200.06014.73
5.3.280.0200.06014.81
5.3.270.0330.04714.88
5.3.260.0270.07014.80
5.3.250.0470.04714.86
5.3.240.0330.04314.71
5.3.230.0300.05314.67
5.3.220.0300.05714.71
5.3.210.0330.08014.74
5.3.200.0270.05714.86
5.3.190.0300.05314.86
5.3.180.0300.05014.86
5.3.170.0230.05714.66
5.3.160.0300.05014.86
5.3.150.0270.05714.85
5.3.140.0230.05714.66
5.3.130.0370.04714.61
5.3.120.0430.06314.75
5.3.110.0300.06014.84
5.3.100.0230.06014.23
5.3.90.0300.06014.19
5.3.80.0370.04714.27
5.3.70.0300.07014.13
5.3.60.0300.05314.11
5.3.50.0330.05714.23
5.3.40.0300.07314.05
5.3.30.0300.05013.99
5.3.20.0300.05313.86
5.3.10.0230.05313.76
5.3.00.0270.05313.83
5.2.170.0270.05011.49
5.2.160.0300.04011.47
5.2.150.0270.03711.23
5.2.140.0200.04711.24
5.2.130.0330.04311.45
5.2.120.0330.03011.37
5.2.110.0200.04011.38
5.2.100.0270.03311.30
5.2.90.0270.04711.17
5.2.80.0270.03711.21
5.2.70.0170.05011.16
5.2.60.0270.04311.29
5.2.50.0200.04311.29
5.2.40.0200.03711.20
5.2.30.0170.04711.16
5.2.20.0230.03311.23
5.2.10.0200.04011.10
5.2.00.0230.05010.98
5.1.60.0300.02710.14
5.1.50.0130.04010.16
5.1.40.0270.03010.23
5.1.30.0170.04710.55
5.1.20.0170.03710.51
5.1.10.0170.04010.38
5.1.00.0270.03010.30
5.0.50.0130.0278.56
5.0.40.0070.0338.42
5.0.30.0200.0378.26
5.0.20.0100.0338.21
5.0.10.0100.0438.38
5.0.00.0070.0508.16
4.4.90.0070.0276.58
4.4.80.0230.0176.58
4.4.70.0100.0236.58
4.4.60.0130.0206.58
4.4.50.0170.0206.58
4.4.40.0070.0406.58
4.4.30.0100.0236.58
4.4.20.0070.0236.58
4.4.10.0100.0306.58
4.4.00.0170.0306.58
4.3.110.0200.0236.58
4.3.100.0100.0236.58
4.3.90.0170.0136.58
4.3.80.0070.0376.58
4.3.70.0130.0206.58
4.3.60.0070.0236.58
4.3.50.0070.0276.58
4.3.40.0030.0406.58
4.3.30.0000.0276.58
4.3.20.0100.0206.58
4.3.10.0070.0236.58
4.3.00.0170.0176.68

preferences:
56.72 ms | 400 KiB | 5 Q