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 $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.0060.01217.13
8.3.50.0130.00922.13
8.3.40.0090.00919.34
8.3.30.0120.00319.23
8.3.20.0000.00720.59
8.3.10.0050.00322.14
8.3.00.0090.00019.63
8.2.180.0120.00619.04
8.2.170.0070.00722.96
8.2.160.0070.00720.69
8.2.150.0040.00424.18
8.2.140.0050.00324.66
8.2.130.0040.00426.16
8.2.120.0040.00419.73
8.2.110.0000.01019.55
8.2.100.0040.00818.25
8.2.90.0080.00019.55
8.2.80.0000.00818.24
8.2.70.0040.00417.99
8.2.60.0000.00818.30
8.2.50.0050.00518.07
8.2.40.0060.00320.32
8.2.30.0030.00618.46
8.2.20.0000.00818.23
8.2.10.0000.00818.32
8.2.00.0030.00518.16
8.1.280.0110.00425.92
8.1.270.0060.00320.90
8.1.260.0070.00026.35
8.1.250.0040.00428.09
8.1.240.0000.00922.52
8.1.230.0000.01217.91
8.1.220.0000.00818.04
8.1.210.0050.00318.77
8.1.200.0090.00317.85
8.1.190.0040.00417.73
8.1.180.0080.00018.10
8.1.170.0000.00818.96
8.1.160.0040.00422.26
8.1.150.0070.00019.02
8.1.140.0080.00017.86
8.1.130.0040.00418.13
8.1.120.0000.00717.92
8.1.110.0090.00017.75
8.1.100.0040.00417.73
8.1.90.0050.00217.87
8.1.80.0050.00317.86
8.1.70.0030.00317.80
8.1.60.0040.00417.92
8.1.50.0000.00917.92
8.1.40.0080.00017.77
8.1.30.0040.00417.94
8.1.20.0040.00418.03
8.1.10.0040.00418.07
8.1.00.0000.00817.81
8.0.300.0040.00418.77
8.0.290.0040.00417.38
8.0.280.0080.00018.74
8.0.270.0050.00317.52
8.0.260.0030.00317.48
8.0.250.0000.00717.46
8.0.240.0000.00817.38
8.0.230.0040.00417.33
8.0.220.0030.00317.35
8.0.210.0000.00717.27
8.0.200.0000.00617.34
8.0.190.0000.00817.43
8.0.180.0000.00717.34
8.0.170.0040.00417.26
8.0.160.0040.00417.26
8.0.150.0070.00017.27
8.0.140.0030.00317.36
8.0.130.0000.00613.82
8.0.120.0040.00417.35
8.0.110.0040.00417.16
8.0.100.0080.00017.20
8.0.90.0040.00417.19
8.0.80.0060.01017.30
8.0.70.0040.00417.32
8.0.60.0030.00517.37
8.0.50.0040.00417.29
8.0.30.0100.01317.59
8.0.20.0130.01117.56
8.0.10.0000.00817.30
8.0.00.0100.00817.16
7.4.330.0060.00015.26
7.4.320.0080.00017.00
7.4.300.0030.00317.07
7.4.290.0000.01017.16
7.4.280.0000.00816.92
7.4.270.0030.00517.11
7.4.260.0050.00317.02
7.4.250.0030.00616.98
7.4.240.0040.00417.15
7.4.230.0040.00416.98
7.4.220.0170.00317.02
7.4.210.0050.01117.13
7.4.200.0000.00717.08
7.4.160.0160.00816.85
7.4.150.0060.01217.40
7.4.140.0130.00617.86
7.4.130.0110.00616.98
7.4.120.0080.00917.04
7.4.110.0060.02117.22
7.4.100.0110.01316.88
7.4.90.0130.00316.97
7.4.80.0090.00919.39
7.4.70.0090.00917.04
7.4.60.0160.00316.90
7.4.50.0000.00517.01
7.4.40.0070.01016.93
7.4.30.0090.00916.75
7.4.00.0050.01315.29
7.3.330.0000.00613.43
7.3.320.0070.00713.35
7.3.310.0030.00316.40
7.3.300.0070.00016.67
7.3.290.0040.00416.63
7.3.280.0110.00516.69
7.3.270.0180.02117.40
7.3.260.0120.00616.71
7.3.250.0080.01116.97
7.3.240.0030.01316.90
7.3.230.0060.01416.97
7.3.210.0140.00616.86
7.3.200.0110.01119.39
7.3.190.0070.01016.79
7.3.180.0060.01116.70
7.3.170.0070.01416.66
7.3.160.0120.01116.84
7.3.120.0050.01014.97
7.3.110.0070.00915.19
7.3.100.0040.00814.97
7.3.90.0040.00615.09
7.3.80.0090.00315.15
7.3.70.0080.00514.89
7.3.60.0060.01015.15
7.3.50.0020.01514.96
7.3.40.0110.00415.13
7.3.30.0070.01015.19
7.3.20.0070.00516.88
7.3.10.0100.00416.88
7.3.00.0080.00616.92
7.2.330.0170.00717.08
7.2.320.0100.00717.20
7.2.310.0040.01816.92
7.2.300.0130.00316.97
7.2.290.0180.00616.76
7.2.250.0130.00715.37
7.2.240.0030.01315.23
7.2.230.0110.00515.24
7.2.220.0080.00615.39
7.2.210.0060.00715.38
7.2.200.0030.00815.42
7.2.190.0080.01115.18
7.2.180.0030.01115.62
7.2.170.0070.01015.28
7.2.160.0030.01015.32
7.2.150.0000.01617.28
7.2.140.0000.01017.28
7.2.130.0050.00917.04
7.2.120.0070.00517.16
7.2.110.0040.00617.17
7.2.100.0050.01017.16
7.2.90.0030.01117.25
7.2.80.0070.00617.16
7.2.70.0070.00917.07
7.2.60.0050.00617.15
7.2.50.0070.00817.11
7.2.40.0070.00817.27
7.2.30.0080.00717.24
7.2.20.0080.00917.12
7.2.10.0080.00417.15
7.2.00.0070.00817.76
7.1.330.0030.01016.16
7.1.320.0020.01116.03
7.1.310.0030.00916.11
7.1.300.0050.01216.05
7.1.290.0060.00516.04
7.1.280.0090.00716.08
7.1.270.0090.00716.08
7.1.260.0060.00616.07
7.1.250.0080.00216.02
7.1.240.0030.00915.71
7.1.230.0080.00816.08
7.1.220.0070.00715.86
7.1.210.0090.00615.71
7.1.200.0050.00615.94
7.1.190.0060.00916.05
7.1.180.0100.00615.94
7.1.170.0070.01016.04
7.1.160.0090.00616.20
7.1.150.0040.00815.92
7.1.140.0040.01115.98
7.1.130.0100.00315.73
7.1.120.0060.00615.97
7.1.110.0040.01116.03
7.1.100.0020.01016.98
7.1.90.0070.00716.13
7.1.80.0090.00616.15
7.1.70.0030.01016.82
7.1.60.0070.01017.76
7.1.50.0080.01016.56
7.1.40.0100.00316.00
7.1.30.0030.01215.82
7.1.20.0100.00615.94
7.1.10.0070.00415.87
7.1.00.0050.04019.17
7.0.330.0060.00615.52
7.0.320.0030.00715.68
7.0.310.0040.00715.48
7.0.300.0040.00815.69
7.0.290.0000.00715.72
7.0.280.0100.00015.21
7.0.270.0050.00515.45
7.0.260.0000.01015.54
7.0.250.0060.00615.73
7.0.240.0100.00015.66
7.0.230.0090.00315.45
7.0.220.0000.01215.51
7.0.210.0040.01115.50
7.0.200.0100.00716.15
7.0.190.0040.00715.64
7.0.180.0060.00615.78
7.0.170.0030.00615.48
7.0.160.0070.00415.71
7.0.150.0040.00715.70
7.0.140.0030.03218.80
7.0.130.0050.00315.64
7.0.120.0030.00615.72
7.0.110.0130.02717.87
7.0.100.0050.02617.93
7.0.90.0050.02717.90
7.0.80.0100.02217.85
7.0.70.0180.03517.74
7.0.60.0080.02317.83
7.0.50.0280.05017.91
7.0.40.0080.03716.77
7.0.30.0100.04016.74
7.0.20.0050.04516.69
7.0.10.0050.04516.64
7.0.00.0070.04416.79
5.6.380.0030.01014.35
5.6.370.0030.00714.63
5.6.360.0030.01014.29
5.6.350.0110.00014.48
5.6.340.0040.00414.55
5.6.330.0000.00814.55
5.6.320.0060.00614.94
5.6.310.0070.00314.25
5.6.300.0070.00714.48
5.6.290.0030.00514.20
5.6.280.0020.04217.77
5.6.270.0040.00814.32
5.6.260.0050.02217.81
5.6.250.0030.02417.52
5.6.240.0050.02717.62
5.6.230.0070.02317.69
5.6.220.0030.02517.69
5.6.210.0070.03817.54
5.6.200.0050.04117.56
5.6.190.0080.02617.73
5.6.180.0050.04417.46
5.6.170.0080.04117.47
5.6.160.0060.04317.40
5.6.150.0050.04517.52
5.6.140.0030.04417.41
5.6.130.0070.04017.62
5.6.120.0030.04517.57
5.6.110.0150.03417.51
5.6.100.0070.04017.69
5.6.90.0050.04017.50
5.6.80.0080.04017.33
5.6.70.0050.04317.12
5.6.60.0040.04217.04
5.6.50.0050.04217.11
5.6.40.0090.04017.17
5.6.30.0080.04317.20
5.6.20.0000.05017.22
5.6.10.0060.04117.19
5.6.00.0020.03817.24
5.5.380.0020.02514.39
5.5.370.0030.02514.35
5.5.360.0030.02314.50
5.5.350.0030.04614.43
5.5.340.0030.04014.55
5.5.330.0100.03414.61
5.5.320.0080.03814.69
5.5.310.0050.04414.61
5.5.300.0070.04014.71
5.5.290.0050.04814.80
5.5.280.0070.04014.77
5.5.270.0030.05214.80
5.5.260.0000.03414.67
5.5.250.0050.04114.21
5.5.240.0090.03514.35
5.5.230.0080.04214.24
5.5.220.0060.04214.29
5.5.210.0010.04314.40
5.5.200.0070.04014.48
5.5.190.0060.03114.21
5.5.180.0160.03214.31
5.5.170.0060.00311.16
5.5.160.0050.04214.29
5.5.150.0050.04014.24
5.5.140.0100.02014.29
5.5.130.0050.03814.47
5.5.120.0070.03714.40
5.5.110.0110.03614.37
5.5.100.0030.04114.05
5.5.90.0040.04214.34
5.5.80.0090.03614.24
5.5.70.0090.03913.99
5.5.60.0070.02314.40
5.5.50.0070.03614.15
5.5.40.0130.02814.35
5.5.30.0090.03714.20
5.5.20.0050.04314.27
5.5.10.0090.03814.15
5.5.00.0110.03814.27
5.4.450.0070.04715.27
5.4.440.0090.03115.36
5.4.430.0080.04015.50
5.4.420.0000.04615.30
5.4.410.0070.03515.15
5.4.400.0060.04015.18
5.4.390.0080.03615.05
5.4.380.0050.03815.09
5.4.370.0060.03915.01
5.4.360.0100.03815.08
5.4.350.0030.04415.04
5.4.340.0070.04014.90
5.4.330.0000.00910.92
5.4.320.0070.04015.00
5.4.310.0060.03615.04
5.4.300.0070.03815.03
5.4.290.0030.02314.99
5.4.280.0060.02415.04
5.4.270.0110.02815.17
5.4.260.0090.03515.20
5.4.250.0070.03815.07
5.4.240.0100.04015.09
5.4.230.0030.03115.08
5.4.220.0130.03015.13
5.4.210.0050.04015.08
5.4.200.0050.04315.21
5.4.190.0060.04115.16
5.4.180.0030.04215.01
5.4.170.0040.03815.14
5.4.160.0060.04315.18
5.4.150.0050.04215.08
5.4.140.0060.03613.88
5.4.130.0050.04013.93
5.4.120.0050.04213.94
5.4.110.0060.03613.86
5.4.100.0050.03913.70
5.4.90.0050.03413.91
5.4.80.0080.03613.61
5.4.70.0050.03913.80
5.4.60.0070.02013.74
5.4.50.0020.04613.82
5.4.40.0070.03713.74
5.4.30.0070.03713.86
5.4.20.0080.03713.80
5.4.10.0070.03813.82
5.4.00.0070.03613.52
5.3.290.0080.03812.86
5.3.280.0100.03812.65
5.3.270.0030.04312.66
5.3.260.0030.03212.66
5.3.250.0050.03712.72
5.3.240.0070.03812.64
5.3.230.0050.03712.71
5.3.220.0050.04112.74
5.3.210.0080.03712.63
5.3.200.0080.03312.75
5.3.190.0050.04012.68
5.3.180.0100.03312.67
5.3.170.0050.03812.74
5.3.160.0060.03612.75
5.3.150.0060.04112.67
5.3.140.0020.02612.70
5.3.130.0020.04312.71
5.3.120.0080.03512.66
5.3.110.0070.03612.66
5.3.100.0040.04412.39
5.3.90.0050.03812.38
5.3.80.0050.03812.47
5.3.70.0080.03512.23
5.3.60.0000.03012.41
5.3.50.0050.03712.30
5.3.40.0030.04412.33
5.3.30.0070.03612.40
5.3.20.0070.02312.28
5.3.10.0050.03712.12
5.3.00.0080.03512.09
5.2.170.0070.02410.78
5.2.160.0080.03010.76
5.2.150.0070.03210.80
5.2.140.0050.03210.70
5.2.130.0020.03410.68
5.2.120.0050.03010.73
5.2.110.0050.03510.78
5.2.100.0050.02910.75
5.2.90.0050.02910.71
5.2.80.0030.03210.67
5.2.70.0090.02810.67
5.2.60.0030.03310.66
5.2.50.0060.03310.72
5.2.40.0030.03010.71
5.2.30.0060.02810.66
5.2.20.0070.03010.70
5.2.10.0030.03210.61
5.2.00.0030.02510.54
5.1.60.0050.02810.20
5.1.50.0040.02510.18
5.1.40.0050.02810.16
5.1.30.0010.03110.39
5.1.20.0050.02810.37
5.1.10.0030.03110.26
5.1.00.0030.03010.35
5.0.50.0030.02510.07
5.0.40.0020.02310.07
5.0.30.0000.02710.07
5.0.20.0030.02010.07
5.0.10.0020.02710.07
5.0.00.0060.03010.07
4.4.90.0000.02110.07
4.4.80.0020.01310.07
4.4.70.0000.02210.07
4.4.60.0020.01910.07
4.4.50.0000.01910.07
4.4.40.0020.02810.07
4.4.30.0050.01510.07
4.4.20.0000.01610.07
4.4.10.0030.01810.07
4.4.00.0010.02910.07
4.3.110.0050.01510.07
4.3.100.0060.01310.07
4.3.90.0000.02010.07
4.3.80.0020.02910.07
4.3.70.0050.01610.07
4.3.60.0030.01810.07
4.3.50.0020.02010.07
4.3.40.0000.02710.07
4.3.30.0000.01510.07
4.3.20.0050.01510.07
4.3.10.0070.01310.07
4.3.00.0030.01610.07

preferences:
49.84 ms | 401 KiB | 5 Q