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.60.0140.00018.53
8.3.50.0040.01116.42
8.3.40.0110.00719.62
8.3.30.0130.00918.79
8.3.20.0080.00024.18
8.3.10.0050.00324.66
8.3.00.0000.00926.16
8.2.180.0110.00625.92
8.2.170.0090.00622.96
8.2.160.0110.00322.96
8.2.150.0060.00325.66
8.2.140.0030.00524.66
8.2.130.0050.00226.16
8.2.120.0090.00026.35
8.2.110.0070.00321.47
8.2.100.0060.00619.52
8.2.90.0000.00720.67
8.2.80.0000.00820.73
8.2.70.0040.00417.50
8.2.60.0030.00517.63
8.2.50.0050.00318.05
8.2.40.0040.00418.25
8.2.30.0070.00018.26
8.2.20.0080.00018.26
8.2.10.0040.00419.61
8.2.00.0000.00719.52
8.1.280.0090.00625.92
8.1.270.0050.00323.99
8.1.260.0000.00828.09
8.1.250.0040.00428.09
8.1.240.0030.00722.48
8.1.230.0040.00821.08
8.1.220.0050.00318.01
8.1.210.0080.00019.16
8.1.200.0030.00617.66
8.1.190.0030.00517.35
8.1.180.0060.00318.10
8.1.170.0090.00017.62
8.1.160.0000.00719.08
8.1.150.0000.00819.12
8.1.140.0070.00019.11
8.1.130.0040.00420.28
8.1.120.0050.00217.71
8.1.110.0030.00617.59
8.1.100.0040.00417.65
8.1.90.0000.00717.76
8.1.80.0000.00817.59
8.1.70.0040.00417.77
8.1.60.0060.00317.91
8.1.50.0000.00817.78
8.1.40.0040.00417.77
8.1.30.0030.00617.90
8.1.20.0030.00618.00
8.1.10.0030.00617.84
8.1.00.0060.00317.72
8.0.300.0040.00420.41
8.0.290.0000.00817.00
8.0.280.0030.00318.80
8.0.270.0000.00918.24
8.0.260.0070.00018.66
8.0.250.0000.00717.09
8.0.240.0030.00317.26
8.0.230.0030.00317.12
8.0.220.0060.00317.20
8.0.210.0040.00417.14
8.0.200.0040.00417.24
8.0.190.0030.00817.12
8.0.180.0080.00017.19
8.0.170.0040.00417.12
8.0.160.0000.00717.16
8.0.150.0050.00316.93
8.0.140.0000.00716.98
8.0.130.0060.00013.55
8.0.120.0030.00517.08
8.0.110.0050.00317.07
8.0.100.0070.00017.02
8.0.90.0040.00517.09
8.0.80.0050.01017.23
8.0.70.0040.00417.14
8.0.60.0040.00417.25
8.0.50.0000.00817.18
8.0.30.0090.00917.30
8.0.20.0080.01217.28
8.0.10.0040.00417.09
8.0.00.0100.01017.09
7.4.330.0000.00515.55
7.4.320.0000.00616.89
7.4.300.0030.00316.77
7.4.290.0040.00416.77
7.4.280.0040.00416.66
7.4.270.0070.00016.91
7.4.260.0030.00313.62
7.4.250.0000.00916.74
7.4.240.0040.00416.77
7.4.230.0050.00316.84
7.4.220.0020.00616.83
7.4.210.0070.00916.93
7.4.200.0030.00316.74
7.4.130.0110.01216.83
7.4.120.0100.01216.82
7.4.110.0070.01116.83
7.4.100.0030.01316.79
7.4.90.0100.00716.77
7.4.80.0090.00919.39
7.4.70.0140.00316.98
7.4.60.0120.00316.77
7.4.50.0090.00916.63
7.4.40.0140.00716.81
7.4.30.0060.01116.51
7.4.20.0060.01716.64
7.4.10.0080.01216.74
7.4.00.0060.01216.87
7.3.330.0090.00016.42
7.3.320.0040.00413.63
7.3.310.0030.00316.67
7.3.300.0000.00716.64
7.3.290.0080.01116.62
7.3.260.0080.01316.75
7.3.240.0130.00616.79
7.3.230.0160.00616.71
7.3.210.0070.01016.89
7.3.200.0090.00916.78
7.3.190.0060.01216.70
7.3.180.0150.00716.68
7.3.170.0200.00316.62
7.3.160.0110.00616.55
7.3.150.0170.00016.88
7.3.140.0140.00316.84
7.3.130.0060.01216.67
7.3.120.0080.00816.83
7.3.110.0100.00716.73
7.3.100.0060.01016.63
7.3.90.0070.01116.63
7.3.80.0070.01516.55
7.3.70.0090.00916.72
7.3.60.0100.00716.68
7.3.50.0080.01116.63
7.3.40.0120.00616.61
7.3.30.0040.01416.61
7.3.20.0100.01116.59
7.3.10.0110.00716.69
7.3.00.0030.01516.64
7.2.330.0110.00816.99
7.2.320.0120.00916.93
7.2.310.0090.01216.70
7.2.300.0060.01616.99
7.2.290.0050.01616.76
7.2.280.0040.01417.09
7.2.270.0100.01116.96
7.2.260.0040.01416.83
7.2.250.0110.00616.91
7.2.240.0110.00616.98
7.2.230.0100.01016.98
7.2.220.0100.00917.00
7.2.210.0060.01216.59
7.2.200.0060.01216.92
7.2.190.0090.00916.70
7.2.180.0040.01416.83
7.2.170.0120.00616.90
7.2.160.0060.01216.89
7.2.150.0100.01316.89
7.2.140.0180.00616.82
7.2.130.0060.01516.96
7.2.120.0080.01116.93
7.2.110.0150.00316.68
7.2.100.0130.00817.04
7.2.90.0120.00916.96
7.2.80.0100.00916.95
7.2.70.0100.01116.84
7.2.60.0460.00616.93
7.2.50.0140.00516.91
7.2.40.0000.01816.87
7.2.30.0130.00616.83
7.2.20.0090.00917.05
7.2.10.0050.01316.91
7.2.00.0090.00916.75

preferences:
59.39 ms | 401 KiB | 5 Q