3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml_1 = '<namesilo> <request> <operation>getDomainInfo</operation> <ip>55.555.55.55</ip> </request> <reply> <code>300</code> <detail>success</detail> <created>2009-01-11</created> <expires>2017-01-11</expires> <status>Active</status> <locked>Yes</locked> <private>Yes</private> <auto_renew>Yes</auto_renew> <traffic_type>Forwarded</traffic_type> <email_verification_required>No</email_verification_required> <portfolio>Main Portfolio</portfolio> <forward_url>https://www.namesilo.net</forward_url> <forward_type>Temporary Forward (302)</forward_type> <nameservers> <nameserver position="1">NS1.NAMESILO.COM</nameserver> <nameserver position="2">NS2.NAMESILO.COM</nameserver> </nameservers> <contact_ids> <registrant>444444</registrant> <administrative>555555</administrative> <technical>666666</technical> <billing>7777777</billing> </contact_ids> </reply> </namesilo>'; $xml_2 = '<namesilo><request><operation>checkRegisterAvailability</operation><ip>1.1.1.1</ip></request><reply><code>300</code><detail>success</detail><available><domain price="11.79" premium="0">nononononodneodneond.net</domain></available></reply></namesilo>'; $simple_test_1 = new simplexmlelement($xml_1); $simple_test_2 = new simplexmlelement($xml_2); function formatResponse($data, $assoc = false) { $data = json_decode(json_encode($data)); $data = formatAttributes($data); return json_decode(json_encode($data), $assoc); } function formatAttributes($attributes) { foreach ($attributes as $key => $attribute) { if (is_array($attribute)) { $attributes->{$key} = formatAttributes((object)$attribute); $attributes->{$key} = (array)$attributes->{$key}; } if (is_object($attribute)) { $attributes->{$key} = formatAttributes($attribute); if (isset($attribute->{'@attributes'})) { unset($attributes->{$key}->{'@attributes'}); } } if (!is_scalar($attributes->{$key})) { foreach ($attributes->{$key} as $a_key => $items) { if (!is_scalar($items)) { if (count((array)$items) == 1 && is_array($attributes->{$key})) { $attributes->{$key}[$a_key] = $items->{0}; } if (count((array) $items) == 1 && is_object($attributes->{$key})) { if (isset($items->{0})) { $attributes->{$key}->{$a_key} = $items->{0}; } } } } } } return $attributes; } //print_r(formatResponse($simple_test_1)); print_r(formatResponse($simple_test_2));

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.70.0070.01016.75
8.3.60.0120.00318.80
8.3.50.0110.00816.75
8.3.40.0090.00919.41
8.3.30.0160.00018.98
8.3.20.0030.00524.18
8.3.10.0040.00424.66
8.3.00.0060.00326.16
8.2.190.0180.00416.62
8.2.180.0150.00025.92
8.2.170.0130.01019.16
8.2.160.0070.00722.96
8.2.150.0040.00425.66
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0040.00421.10
8.2.110.0060.00320.54
8.2.100.0060.00617.88
8.2.90.0060.00318.18
8.2.80.0050.00318.89
8.2.70.0080.00017.75
8.2.60.0000.00817.50
8.2.50.0040.00418.05
8.2.40.0000.00818.41
8.2.30.0000.00718.34
8.2.20.0040.00418.26
8.2.10.0050.00319.45
8.2.00.0040.00419.52
8.1.280.0150.00725.92
8.1.270.0060.00323.99
8.1.260.0030.00726.35
8.1.250.0000.00728.09
8.1.240.0030.00624.11
8.1.230.0040.00717.48
8.1.220.0080.00018.82
8.1.210.0080.00018.77
8.1.200.0080.00017.80
8.1.190.0060.00317.48
8.1.180.0030.00618.10
8.1.170.0040.00417.62
8.1.160.0030.00519.14
8.1.150.0040.00419.15
8.1.140.0040.00419.11
8.1.130.0060.00319.34
8.1.120.0000.00817.81
8.1.110.0040.00417.75
8.1.100.0040.00417.60
8.1.90.0040.00417.79
8.1.80.0000.00717.80
8.1.70.0030.00317.73
8.1.60.0060.00317.74
8.1.50.0050.00317.77
8.1.40.0040.00417.83
8.1.30.0030.00617.90
8.1.20.0080.00017.90
8.1.10.0060.00317.86
8.1.00.0030.00617.80
8.0.300.0050.00318.77
8.0.290.0040.00417.13
8.0.280.0000.00718.64
8.0.270.0070.00018.23
8.0.260.0030.00317.04
8.0.250.0000.00717.15
8.0.240.0030.00517.21
8.0.230.0040.00417.09
8.0.220.0080.00017.05
8.0.210.0030.00317.05
8.0.200.0000.00717.18
8.0.190.0030.00717.06
8.0.180.0060.00317.11
8.0.170.0050.00317.20
8.0.160.0000.00717.09
8.0.150.0040.00417.05
8.0.140.0040.00317.10
8.0.130.0030.00313.63
8.0.120.0000.00717.00
8.0.110.0080.00016.99
8.0.100.0080.00017.20
8.0.90.0030.00616.95
8.0.80.0110.00817.08
8.0.70.0040.00416.93
8.0.60.0000.00917.03
8.0.50.0030.00517.07
8.0.30.0150.00417.19
8.0.20.0120.00917.45
8.0.10.0000.00817.36
8.0.00.0110.00916.99
7.4.330.0050.00015.55
7.4.320.0000.00616.77
7.4.300.0060.00016.75
7.4.290.0040.00416.73
7.4.280.0000.00816.63
7.4.270.0030.00316.81
7.4.260.0070.00013.49
7.4.250.0000.00716.81
7.4.240.0050.00316.75
7.4.230.0040.00416.79
7.4.220.0000.00716.83
7.4.210.0050.01116.77
7.4.200.0070.00016.82
7.4.130.0080.01016.73
7.4.120.0140.00716.62
7.4.110.0100.00716.71
7.4.100.0070.01116.78
7.4.90.0090.00916.84
7.4.80.0160.00019.39
7.4.70.0090.00816.66
7.4.60.0040.01416.73
7.4.50.0070.01016.53
7.4.40.0030.01616.82
7.4.30.0140.00316.70
7.4.20.0070.01116.48
7.4.10.0110.00716.82
7.4.00.0040.01516.70
7.3.330.0030.00316.46
7.3.320.0040.00413.40
7.3.310.0000.00716.52
7.3.300.0040.00416.48
7.3.290.0060.01216.60
7.3.260.0140.00616.93
7.3.240.0100.01116.72
7.3.230.0130.01016.81
7.3.210.0090.00916.78
7.3.200.0030.01316.88
7.3.190.0000.01716.61
7.3.180.0130.00316.48
7.3.170.0080.00816.79
7.3.160.0090.00616.51
7.3.150.0120.00616.75
7.3.140.0090.00916.63
7.3.130.0100.00716.55
7.3.120.0220.01016.60
7.3.110.0070.01416.46
7.3.100.0070.01616.69
7.3.90.0090.00916.77
7.3.80.0120.00616.70
7.3.70.0170.01716.63
7.3.60.0150.00416.66
7.3.50.0060.01116.64
7.3.40.0090.00616.57
7.3.30.0040.01316.38
7.3.20.0030.01516.43
7.3.10.0100.00916.56
7.3.00.0000.01916.52
7.2.330.0140.00417.08
7.2.320.0180.00316.64
7.2.310.0070.01016.80
7.2.300.0180.00016.73
7.2.290.0100.00617.00
7.2.280.0120.00816.96
7.2.270.0050.01317.01
7.2.260.0070.01216.80
7.2.250.0030.02016.95
7.2.240.0110.01216.97
7.2.230.0120.00916.74
7.2.220.0060.01817.00
7.2.210.0120.02216.79
7.2.200.0090.00916.54
7.2.190.0140.00416.80
7.2.180.0170.00616.82
7.2.170.0130.00616.65
7.2.160.0050.01416.80
7.2.150.0140.00416.88
7.2.140.0030.01616.89
7.2.130.0120.00816.94
7.2.120.0150.00416.86
7.2.110.0110.00616.68
7.2.100.0140.00616.85
7.2.90.0110.00716.95
7.2.80.0040.01416.93
7.2.70.0700.00317.05
7.2.60.0030.01616.67
7.2.50.0090.01316.93
7.2.40.0120.00916.92
7.2.30.0140.00616.91
7.2.20.0080.01116.86
7.2.10.0060.01216.85
7.2.00.0130.00716.99

preferences:
70.77 ms | 401 KiB | 5 Q