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); echo $res;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.0070.01518.80
8.3.50.0090.01022.19
8.3.40.0140.00719.38
8.3.30.0000.01519.28
8.3.20.0040.00420.71
8.3.10.0050.00322.10
8.3.00.0060.00319.63
8.2.180.0100.00618.91
8.2.170.0040.01122.96
8.2.160.0070.00720.77
8.2.150.0080.00024.18
8.2.140.0080.00024.66
8.2.130.0070.00426.16
8.2.120.0060.00319.74
8.2.110.0030.00620.71
8.2.100.0090.00318.41
8.2.90.0030.00519.59
8.2.80.0000.00818.13
8.2.70.0000.00818.13
8.2.60.0040.00418.29
8.2.50.0080.00018.07
8.2.40.0040.00420.16
8.2.30.0030.00618.38
8.2.20.0040.00418.23
8.2.10.0050.00318.35
8.2.00.0000.00818.16
8.1.280.0150.00025.92
8.1.270.0000.00920.98
8.1.260.0100.00326.35
8.1.250.0120.00328.09
8.1.240.0130.00022.40
8.1.230.0090.00322.87
8.1.220.0000.00818.03
8.1.210.0000.00818.77
8.1.200.0030.00617.73
8.1.190.0000.00917.60
8.1.180.0060.00318.10
8.1.170.0000.00819.06
8.1.160.0000.00822.24
8.1.150.0070.00019.07
8.1.140.0000.00917.69
8.1.130.0050.00218.07
8.1.120.0080.00017.73
8.1.110.0000.00817.91
8.1.100.0000.00717.84
8.1.90.0070.00017.74
8.1.80.0030.00517.72
8.1.70.0000.00717.76
8.1.60.0000.00817.87
8.1.50.0000.00817.85
8.1.40.0040.00418.02
8.1.30.0060.00318.11
8.1.20.0030.00518.02
8.1.10.0060.00317.88
8.1.00.0040.00417.76
8.0.300.0040.00418.77
8.0.290.0040.00417.13
8.0.280.0000.00718.71
8.0.270.0000.00817.50
8.0.260.0030.00317.57
8.0.250.0030.00417.52
8.0.240.0030.00517.51
8.0.230.0040.00417.26
8.0.220.0000.00817.32
8.0.210.0030.00317.18
8.0.200.0080.00017.39
8.0.190.0040.00417.40
8.0.180.0050.00317.43
8.0.170.0040.00417.27
8.0.160.0040.00417.28
8.0.150.0000.00717.28
8.0.140.0020.00517.35
8.0.130.0060.00013.73
8.0.120.0060.00317.34
8.0.110.0000.00817.24
8.0.100.0040.00417.14
8.0.90.0050.00217.20
8.0.80.0120.00817.27
8.0.70.0000.00717.38
8.0.60.0050.00317.28
8.0.50.0020.00517.43
8.0.30.0150.01117.66
8.0.20.0110.01517.44
8.0.10.0040.00417.35
8.0.00.0070.01017.32
7.4.330.0000.00515.20
7.4.320.0000.00617.05
7.4.300.0030.00316.98
7.4.290.0040.00716.96
7.4.280.0000.00816.99
7.4.270.0000.00716.93
7.4.260.0040.00416.99
7.4.250.0050.00317.09
7.4.240.0070.00017.00
7.4.230.0000.00816.85
7.4.220.0030.01917.07
7.4.210.0090.00817.03
7.4.200.0040.00416.76
7.4.160.0070.01016.88
7.4.150.0130.00517.40
7.4.140.0100.01117.86
7.4.130.0100.00716.98
7.4.120.0100.00816.97
7.4.110.0110.01117.07
7.4.100.0040.01417.05
7.4.90.0090.00917.07
7.4.80.0160.00619.39
7.4.70.0140.00717.03
7.4.60.0100.00717.26
7.4.50.0000.00616.96
7.4.40.0100.00717.08
7.4.30.0110.00716.93
7.4.00.0120.00615.16
7.3.330.0030.00313.59
7.3.320.0080.00813.51
7.3.310.0030.00316.65
7.3.300.0030.00316.70
7.3.290.0040.00416.69
7.3.280.0090.00716.68
7.3.270.0020.01717.40
7.3.260.0110.00716.92
7.3.250.0080.01016.89
7.3.240.0160.00017.12
7.3.230.0040.01516.65
7.3.210.0110.01416.64
7.3.200.0090.00919.39
7.3.190.0030.01316.77
7.3.180.0050.01116.87
7.3.170.0130.00616.61
7.3.160.0100.00716.92
7.2.330.0170.00716.95
7.2.320.0110.00616.96
7.2.310.0030.01917.02
7.2.300.0130.00617.14
7.2.290.0130.00716.96
7.2.00.0000.01519.78
7.1.100.0090.00618.20
7.1.70.0040.00817.51
7.1.60.0040.02119.50
7.1.50.0100.01317.03
7.1.00.0000.08022.45
7.0.200.0190.00616.84
7.0.140.0030.06722.18
7.0.60.0100.07720.05
7.0.50.0100.03717.97
7.0.40.0070.07720.20
7.0.30.0330.04720.29
7.0.20.0200.05720.18
7.0.10.0230.08020.44
7.0.00.0030.07020.28
5.6.280.0030.07321.04
5.6.210.0000.07020.63
5.6.200.0070.05718.31
5.6.190.0130.08020.82
5.6.180.0270.07020.45
5.6.170.0470.07320.88
5.6.160.0200.07020.56
5.6.150.0030.08018.32
5.6.140.0030.08318.36
5.6.130.0130.06718.30
5.6.120.0130.07321.10
5.6.110.0100.08321.10
5.6.100.0070.06321.26
5.6.90.0270.06021.23
5.6.80.0130.07020.47
5.6.70.0330.07320.62
5.5.350.0170.03320.51
5.5.340.0030.04318.10
5.5.330.0070.07720.37
5.5.320.0030.04320.70
5.5.310.0270.07020.44
5.5.300.0030.06318.11
5.5.290.0070.05318.13
5.5.280.0200.05320.98
5.5.270.0070.06020.96
5.5.260.0270.06020.79
5.5.250.0030.07720.67
5.5.240.0030.05720.38
5.4.450.0700.06019.59
5.4.440.0900.04719.40
5.4.430.0330.06019.69
5.4.420.0430.05719.34
5.4.410.0900.07019.54
5.4.400.0370.05318.93
5.4.390.0330.06018.84
5.4.380.0200.06718.86
5.4.370.0400.04318.73
5.4.360.0270.05718.82
5.4.350.0370.05718.83
5.4.340.0370.06018.64
5.4.320.0330.05718.75
5.4.310.0300.05718.90
5.4.300.0330.06018.80
5.4.290.0370.05018.61
5.4.280.0370.04318.83
5.4.270.0230.06018.83
5.4.260.0300.05018.84
5.4.250.0270.06318.79
5.4.240.0270.06318.83
5.4.230.0370.04318.83
5.4.220.0170.06718.63
5.4.210.0270.05318.80
5.4.200.0270.05016.75
5.4.190.0270.06718.63
5.4.180.0300.05718.78
5.4.170.0300.06718.71
5.4.160.0270.05718.77
5.4.150.0400.04718.82
5.4.140.0300.05716.46
5.4.130.0300.05016.47
5.4.120.0300.05016.17
5.4.110.0330.04716.48
5.4.100.0200.06316.27
5.4.90.0200.06016.51
5.4.80.0300.05016.25
5.4.70.0270.05316.42
5.4.60.0400.03716.38
5.4.50.0400.04016.41
5.4.40.0270.05716.39
5.4.30.0330.04316.23
5.4.20.0430.05016.42
5.4.10.0330.04316.22
5.4.00.0370.04315.75
5.3.290.0230.06314.75
5.3.280.0200.06014.73
5.3.270.0400.05014.67
5.3.260.0300.05314.80
5.3.250.0300.05014.77
5.3.240.0300.05714.88
5.3.230.0270.07014.77
5.3.220.0270.05714.86
5.3.210.0300.05314.84
5.3.200.0300.05014.67
5.3.190.0330.05014.77
5.3.180.0300.04714.84
5.3.170.0330.04714.77
5.3.160.0430.05314.66
5.3.150.0300.06014.84
5.3.140.0230.05314.73
5.3.130.0330.05314.63
5.3.120.0230.06014.63
5.3.110.0330.05014.75
5.3.100.0200.06714.20
5.3.90.0230.06014.32
5.3.80.0300.05014.16
5.3.70.0270.05014.13
5.3.60.0270.05014.21
5.3.50.0270.05014.09
5.3.40.0270.05314.07
5.3.30.0330.04314.08
5.3.20.0230.05013.87
5.3.10.0230.05013.88
5.3.00.0170.05313.83
5.2.170.0200.04711.41
5.2.160.0200.04011.50
5.2.150.0230.04011.25
5.2.140.0200.04311.33
5.2.130.0230.05311.46
5.2.120.0130.04711.37
5.2.110.0200.04711.29
5.2.100.0170.04311.33
5.2.90.0130.04311.17
5.2.80.0130.04311.37
5.2.70.0330.03011.40
5.2.60.0170.04311.31
5.2.50.0130.04711.22
5.2.40.0170.04011.13
5.2.30.0200.04011.09
5.2.20.0170.04011.27
5.2.10.0130.03711.11
5.2.00.0200.03710.86
5.1.60.0100.04310.27
5.1.50.0230.03710.21
5.1.40.0170.03710.13
5.1.30.0230.03010.63
5.1.20.0300.02710.58
5.1.10.0230.03310.30
5.1.00.0200.03310.31
5.0.50.0100.0278.64
5.0.40.0070.0308.57
5.0.30.0100.0478.31
5.0.20.0100.0308.41
5.0.10.0070.0338.22
5.0.00.0200.0378.38
4.4.90.0070.0276.57
4.4.80.0170.0206.57
4.4.70.0170.0236.57
4.4.60.0100.0206.57
4.4.50.0070.0276.57
4.4.40.0070.0406.57
4.4.30.0030.0276.57
4.4.20.0070.0236.57
4.4.10.0100.0206.57
4.4.00.0100.0336.57
4.3.110.0100.0206.57
4.3.100.0170.0136.57
4.3.90.0100.0206.57
4.3.80.0100.0436.57
4.3.70.0130.0176.57
4.3.60.0070.0236.57
4.3.50.0130.0206.57
4.3.40.0100.0336.57
4.3.30.0070.0236.57
4.3.20.0130.0206.57
4.3.10.0030.0236.57
4.3.00.0130.0176.68

preferences:
51.93 ms | 401 KiB | 5 Q