3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* * Some little $_POST values and $apiKey are already set. */ $_POST['datepicker1'] = '2013-06-12'; $_POST['datepicker2'] = '2013-06-16'; $apiKey = '2hkhej72gxyas3ky6hhjtsga'; $destination = $hotel; $adults = '2'; /* * Create the XML for the request with hepl of SimpleXML */ $url = "https://api.eancdn.com/ean-services/rs/hotel/v3/list"; $xml = new SimpleXMLElement('<HotelListRequest/>'); $xml->destinationString = $destination; $xml->arrivalDate = $_POST['datepicker1']; $xml->departureDate = $_POST['datepicker2']; $xml->RoomGroup->Room->numberOfAdults = $adults; /* * Set the parameters for the API request */ $params = [ 'cid' => 55505, 'minorRev' => 99, 'apiKey' => $apiKey, 'locale' => 'pt_BR', 'currencyCode' => 'BRL', 'xml' => $xml->asXML(), ]; /* * Set the stream context for the API request */ $context = stream_context_create(['http' => [ 'method' => 'POST', 'header' => [ 'Accept: application/xml', 'Content-Type: application/x-www-form-urlencoded', ], 'content' => http_build_query($params), ]]); libxml_set_streams_context($context); class MySimpleXMLElement extends SimpleXMLElement { public function addProcessingInstruction($target, $data = NULL) { $node = dom_import_simplexml($this); $pi = $node->ownerDocument->createProcessingInstruction($target, $data); $result = $node->appendChild($pi); return $this; } } /* * Perform the API request (and here: insert the stylesheet PI) */ //$output = '<hotel/>'; $result = simplexml_load_file($url, 'MySimpleXMLElement'); //$hotel->addProcessingInstruction('xml-stylesheet', 'type="text/xsl" href="css/style.xsl"'); //$hotel->asXML('php://output'); //$result = new SimpleXMLElement($hotel); /* function UR_exists($url){ $headers=get_headers($url); return stripos($headers[0],"200 OK")?true:false; } */ /* You can test a URL like this (sample) */ /* $rest = substr((string)$hotel->thumbNailUrl, 0, -5); $rest .= 'y.jpg'; $url = 'http://images.travelnow.com'.$rest; if(UR_exists($url)) { return; } else { continue; } */ ?>

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.0100.01317.13
8.3.50.0050.01321.27
8.3.40.0100.00519.15
8.3.30.0100.00619.16
8.3.20.0000.00820.55
8.3.10.0050.00322.24
8.3.00.0060.00318.30
8.2.180.0070.01818.79
8.2.170.0140.00422.96
8.2.160.0040.01120.72
8.2.150.0080.00324.18
8.2.140.0000.00724.66
8.2.130.0000.00826.16
8.2.120.0060.00318.00
8.2.110.0030.00721.36
8.2.100.0130.00018.00
8.2.90.0000.00819.47
8.2.80.0040.00417.97
8.2.70.0000.00818.00
8.2.60.0000.00918.05
8.2.50.0000.00818.07
8.2.40.0070.00319.63
8.2.30.0000.00721.13
8.2.20.0040.00418.15
8.2.10.0020.00518.47
8.2.00.0050.00318.47
8.1.280.0150.00025.92
8.1.270.0110.00722.40
8.1.260.0000.00826.35
8.1.250.0040.00428.09
8.1.240.0090.00021.62
8.1.230.0060.00618.16
8.1.220.0050.00318.27
8.1.210.0040.00418.77
8.1.200.0050.00517.98
8.1.190.0040.00417.72
8.1.180.0000.00818.10
8.1.170.0040.00418.96
8.1.160.0040.00422.31
8.1.150.0000.00719.25
8.1.140.0050.00317.93
8.1.130.0000.00717.99
8.1.120.0030.00517.82
8.1.110.0000.00817.89
8.1.100.0000.00717.91
8.1.90.0040.00417.79
8.1.80.0000.00717.82
8.1.70.0030.00317.90
8.1.60.0040.00417.83
8.1.50.0000.00817.77
8.1.40.0060.00617.83
8.1.30.0090.00018.00
8.1.20.0050.00317.87
8.1.10.0000.00817.68
8.1.00.0050.00317.66
8.0.300.0080.00018.77
8.0.290.0020.00517.25
8.0.280.0040.00418.73
8.0.270.0030.00317.59
8.0.260.0000.00717.66
8.0.250.0040.00417.25
8.0.240.0040.00417.25
8.0.230.0000.00717.41
8.0.220.0070.00017.29
8.0.210.0050.00217.13
8.0.200.0030.00317.37
8.0.190.0050.00517.32
8.0.180.0000.00717.16
8.0.170.0040.00417.40
8.0.160.0000.00717.19
8.0.150.0050.00317.32
8.0.140.0050.00317.15
8.0.130.0030.00313.80
8.0.120.0000.00817.15
8.0.110.0000.00917.32
8.0.100.0030.00517.05
8.0.90.0040.00417.34
8.0.80.0060.00917.27
8.0.70.0030.00517.29
8.0.60.0000.00817.21
8.0.50.0050.00317.28
8.0.30.0130.00717.49
8.0.20.0100.01117.42
8.0.10.0040.00417.36
8.0.00.0120.00717.11
7.4.330.0060.00015.32
7.4.320.0030.00317.08
7.4.300.0030.00316.65
7.4.290.0050.00216.70
7.4.280.0030.00716.72
7.4.270.0080.00016.82
7.4.260.0030.00316.71
7.4.250.0000.00916.86
7.4.240.0030.00516.96
7.4.230.0040.00416.88
7.4.220.0130.00616.84
7.4.210.0070.00716.96
7.4.200.0040.00416.88
7.4.160.0080.00817.00
7.4.150.0120.00917.40
7.4.140.0120.01017.86
7.4.130.0110.00716.91
7.4.120.0050.01516.91
7.4.110.0070.01116.94
7.4.100.0110.00716.78
7.4.90.0100.00716.99
7.4.80.0090.00819.39
7.4.70.0120.01216.98
7.4.60.0030.01316.91
7.4.50.0030.00616.89
7.4.40.0150.00617.06
7.4.30.0130.01016.66
7.4.00.0030.01215.14
7.3.330.0000.00513.71
7.3.320.0000.00513.87
7.3.310.0040.00416.82
7.3.300.0040.00416.60
7.3.290.0070.00916.77
7.3.280.0100.00516.73
7.3.270.0150.00617.40
7.3.260.0060.01216.82
7.3.250.0060.01216.75
7.3.240.0100.00716.78
7.3.230.0120.00616.82
7.3.210.0070.01016.85
7.3.200.0160.00316.74
7.3.190.0110.00616.70
7.3.180.0150.00317.09
7.3.170.0150.00716.67
7.3.160.0090.00916.73
7.3.120.0060.00915.00
7.3.110.0140.00314.94
7.3.100.0030.01415.07
7.3.90.0060.00915.06
7.3.80.0090.00915.32
7.3.70.0130.00315.12
7.3.60.0070.01115.07
7.3.50.0000.01614.96
7.3.40.0060.00914.96
7.3.30.0080.00815.11
7.3.20.0000.01216.90
7.3.10.0120.00316.73
7.3.00.0090.00616.95
7.2.330.0030.01616.77
7.2.320.0130.01016.92
7.2.310.0070.01016.77
7.2.300.0100.00616.99
7.2.290.0120.00616.89
7.2.250.0090.00915.36
7.2.240.0070.01015.26
7.2.230.0040.01115.12
7.2.220.0070.00715.25
7.2.210.0150.00415.35
7.2.200.0040.00915.20
7.2.190.0070.00315.12
7.2.180.0030.01015.27
7.2.170.0120.00315.08
7.2.160.0060.01215.30
7.2.150.0120.00017.23
7.2.140.0030.01016.98
7.2.130.0040.00717.01
7.2.120.0060.01017.03
7.2.110.0090.00617.40
7.2.100.0000.01216.88
7.2.90.0090.00917.09
7.2.80.0080.00817.25
7.2.70.0090.00317.19
7.2.60.0050.01116.84
7.2.50.0070.01117.04
7.2.40.0120.00816.92
7.2.30.0080.01117.32
7.2.20.0130.00017.34
7.2.10.0120.00316.84
7.2.00.0020.01518.65
7.1.330.0110.00415.68
7.1.320.0090.00915.94
7.1.310.0040.00816.14
7.1.300.0080.00315.85
7.1.290.0000.01315.95
7.1.280.0000.01415.68
7.1.270.0030.00915.95
7.1.260.0030.01015.90
7.1.250.0070.01016.03
7.1.240.0090.00615.82
7.1.230.0090.00616.05
7.1.220.0080.00815.87
7.1.210.0000.00815.88
7.1.200.0030.01015.89
7.1.190.0000.01315.88
7.1.180.0040.00415.94
7.1.170.0090.00316.08
7.1.160.0090.00615.76
7.1.150.0060.00916.11
7.1.140.0000.01615.98
7.1.130.0060.00615.99
7.1.120.0030.00715.80
7.1.110.0030.01016.20
7.1.100.0060.01017.45
7.1.90.0000.01115.98
7.1.80.0050.00515.82
7.1.70.0020.01016.71
7.1.60.0050.00917.58
7.1.50.0080.01016.75
7.1.40.0030.00716.13
7.1.30.0100.00715.81
7.1.20.0120.00316.20
7.1.10.0030.01016.12
7.1.00.0030.04119.41
7.0.330.0090.00015.50
7.0.320.0030.01015.49
7.0.310.0040.00815.63
7.0.300.0100.00315.62
7.0.290.0030.01015.45
7.0.280.0040.01215.46
7.0.270.0090.00615.69
7.0.260.0040.00815.70
7.0.250.0000.01315.54
7.0.240.0090.00315.39
7.0.230.0030.01015.68
7.0.220.0040.01215.56
7.0.210.0000.01515.45
7.0.200.0040.00916.37
7.0.190.0090.00915.35
7.0.180.0120.00615.57
7.0.170.0000.01615.49
7.0.160.0080.00615.64
7.0.150.0030.00915.46
7.0.140.0030.01015.61
7.0.130.0030.00715.79
7.0.120.0000.01515.63
7.0.110.0060.00615.68
7.0.100.0030.01015.68
7.0.90.0040.01115.70
7.0.80.0030.01415.54
7.0.70.0110.00315.68
7.0.60.0050.04218.14
7.0.50.0050.03017.03
7.0.40.0090.04217.06
7.0.30.0190.04817.11
7.0.20.0150.04517.04
7.0.10.0130.03017.03
7.0.00.0090.03617.16
5.6.400.0100.00314.68
5.6.390.0040.01114.95
5.6.380.0060.00314.49
5.6.370.0040.00814.70
5.6.360.0030.00914.68
5.6.350.0030.00914.39
5.6.340.0060.00614.48
5.6.330.0090.00614.41
5.6.320.0060.00314.84
5.6.310.0070.00314.53
5.6.300.0060.00914.26
5.6.290.0000.01414.96
5.6.280.0060.04018.22
5.6.270.0000.01414.87
5.6.260.0070.00314.98
5.6.250.0040.01214.49
5.6.240.0090.00314.50
5.6.230.0150.00014.59
5.6.220.0040.00814.63
5.6.210.0080.03017.99
5.6.200.0090.04516.61
5.6.190.0140.04017.84
5.6.180.0130.03217.97
5.6.170.0150.03117.95
5.6.160.0070.03317.69
5.6.150.0060.02016.53
5.6.140.0020.02816.60
5.6.130.0060.04316.65
5.6.120.0040.02917.95
5.6.110.0020.03018.17
5.6.100.0160.03918.21
5.6.90.0080.02718.00
5.6.80.0100.01817.65
5.6.70.0070.00314.37
5.6.60.0070.00714.45
5.6.50.0070.00714.44
5.6.40.0000.01514.27
5.6.30.0060.00914.79
5.6.20.0080.00814.51
5.6.10.0030.00614.68
5.6.00.0060.00914.52
5.5.380.0030.01214.63
5.5.370.0060.00914.61
5.5.360.0030.01114.51
5.5.350.0080.02117.80
5.5.340.0080.04116.59
5.5.330.0030.02517.81
5.5.320.1520.02617.68
5.5.310.0190.04017.73
5.5.300.0100.03716.56
5.5.290.0050.03616.62
5.5.280.0050.04518.10
5.5.270.0080.03918.01
5.5.260.0120.03517.96
5.5.250.0030.03517.83
5.5.240.0070.04017.47
5.5.230.0090.00914.67
5.5.220.0040.01114.60
5.5.210.0070.01014.59
5.5.200.0040.01114.34
5.5.190.0000.01414.41
5.5.180.0060.00914.55
5.5.170.0030.01014.47
5.5.160.0060.00314.54
5.5.150.0030.00914.66
5.5.140.0070.00714.73
5.5.130.0040.00814.53
5.5.120.0000.01414.37
5.5.110.0040.01114.46
5.5.100.0040.01114.40
5.5.90.0080.00814.31
5.5.80.0070.00714.41
5.5.70.0060.00614.52
5.5.60.0110.00414.29
5.5.50.0060.00914.46
5.5.40.0060.01014.68
5.5.30.0090.00614.56
5.5.20.0000.01114.38
5.5.10.0110.00414.33
5.5.00.0000.01514.24
5.4.450.0350.03516.11
5.4.440.0410.03516.09
5.4.430.0350.03416.13
5.4.420.0370.02916.06
5.4.410.0370.03216.04
5.4.400.0330.03515.93
5.4.390.0320.03115.89
5.4.380.0280.03615.96
5.4.370.0370.03215.91
5.4.360.0350.03215.92
5.4.350.0350.03015.86
5.4.340.0350.03215.85
5.4.330.0090.00311.99
5.4.320.0330.03215.94
5.4.310.0470.02015.87
5.4.300.0370.02715.94
5.4.290.0370.02815.91
5.4.280.0280.03515.90
5.4.270.0410.03615.88
5.4.260.0350.03515.90
5.4.250.0400.02915.93
5.4.240.0370.03215.88
5.4.230.0400.04115.92
5.4.220.0430.03215.86
5.4.210.0420.04315.96
5.4.200.0430.02715.89
5.4.190.0330.03715.89
5.4.180.0460.03015.97
5.4.170.0400.03215.86
5.4.160.0370.03215.87
5.4.150.0310.03715.89
5.4.140.0400.02214.37
5.4.130.0300.03114.25
5.4.120.0330.02814.31
5.4.110.0360.03314.40
5.4.100.0360.03014.33
5.4.90.0340.02814.23
5.4.80.0380.02214.32
5.4.70.0180.03514.33
5.4.60.0020.04514.29
5.4.50.0040.02014.33
5.4.40.0100.02114.27
5.4.30.0210.03514.24
5.4.20.0060.01814.26
5.4.10.0060.00311.99
5.4.00.0030.00911.99

preferences:
57.79 ms | 401 KiB | 5 Q