3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace J7mbo\SeleniumGrid2Api; use J7mbo\SeleniumGrid2Api\Entity\CapabilityFactory, J7mbo\SeleniumGrid2Api\Entity\NodeFactory, GuzzleHttp\Client as HttpClient, GuzzleHttp\Message\Response; /** * Class SeleniumGrid2Api * * @package J7mbo\SeleniumGrid2Api */ class SeleniumGrid2Api { /** * @var int The timeout for the request */ const REQUEST_TIMEOUT = 5; /** * @var HttpClient */ protected $httpClient; /** * @var JsonValidator */ protected $jsonValidator; /** * @var CapabilityFactory */ protected $capabilityFactory; /** * @var NodeFactory */ protected $nodeFactory; /** * @constructor * * @param HttpClient $httpClient * @param JsonValidator $jsonValidator * @param CapabilityFactory $capabilityFactory * @param NodeFactory $nodeFactory */ public function __construct( HttpClient $httpClient, JsonValidator $jsonValidator, CapabilityFactory $capabilityFactory, NodeFactory $nodeFactory ) { $this->httpClient = $httpClient; $this->jsonValidator = $jsonValidator; $this->capabilityFactory = $capabilityFactory; $this->nodeFactory = $nodeFactory; } /** * Get a Node entity representing the running node * * @param string $host * @param int $port * * @throws NotFoundException * * @return Entity\Node */ public function getNode($host = 'localhost', $port = 5555) { $uri = sprintf('http://%s:%d', $host, $port); $request = $this->httpClient->createRequest('GET', sprintf(Endpoints::NODE_STATUS), $uri, [ 'timeout' => self::REQUEST_TIMEOUT ]); try { /** @var Response $response */ /** @noinspection PhpVoidFunctionResultUsedInspection */ $response = $this->httpClient->send($request); if (($status = $response->getStatusCode()) !== 200) { throw new NotFoundException(sprintf('Status code for: %s returned %d', $uri, $status)); } if ($this->jsonValidator->isJson($response->getBody())) { throw new NotFoundException(sprintf('Invalid json returned from: %s', $uri)); } $data = json_decode($response->getBody(), true); $capabilities = []; foreach($data['request']['capabilities'] as $capability) { if ($capability['seleniumProtocol'] === 'WebDriver') { $capabilities[] = $this->capabilityFactory->build( $capability['browsername'], $capability['maxInstances'], $capability['platform'] ); } } return $this->nodeFactory->build($capabilities, $host, $port); } catch (\Exception $e) { throw new NotFoundException($e->getMessage()); } } }

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.4.120.0070.00420.73
8.4.110.0120.00818.86
8.4.100.0070.00717.44
8.4.90.0100.01018.61
8.4.80.0050.00419.39
8.4.70.0050.00517.68
8.4.60.0100.01018.81
8.4.50.0120.00818.43
8.4.40.0030.00617.26
8.4.30.0060.01317.37
8.4.20.0130.00717.59
8.4.10.0030.00617.46
8.3.250.0120.00718.86
8.3.240.0100.01016.62
8.3.230.0120.00616.61
8.3.220.0100.00817.09
8.3.210.0050.00418.15
8.3.200.0110.00716.67
8.3.190.0090.00717.24
8.3.180.0060.00218.53
8.3.170.0160.00317.23
8.3.160.0180.00018.15
8.3.150.0060.01220.71
8.3.140.0030.00617.28
8.3.130.0060.00318.48
8.3.120.0090.00018.40
8.3.110.0000.00916.47
8.3.100.0040.00418.34
8.3.90.0090.00618.21
8.3.80.0060.00617.97
8.3.70.0110.00716.38
8.3.60.0140.00716.63
8.3.50.0120.00522.93
8.3.40.0000.01418.72
8.3.30.0040.01118.92
8.3.20.0040.00420.21
8.3.10.0000.00823.63
8.3.00.0000.00819.56
8.2.290.0040.00320.21
8.2.280.0150.00418.19
8.2.270.0090.00916.89
8.2.260.0040.00416.68
8.2.250.0040.00719.85
8.2.240.0050.00318.88
8.2.230.0060.00320.94
8.2.220.0040.00424.06
8.2.210.0090.00626.77
8.2.200.0090.00018.04
8.2.190.0060.01216.58
8.2.180.0120.00316.63
8.2.170.0090.01222.96
8.2.160.0070.01320.35
8.2.150.0050.00324.18
8.2.140.0040.00424.66
8.2.130.0000.00726.16
8.2.120.0050.00319.23
8.2.110.0030.00622.43
8.2.100.0120.00017.78
8.2.90.0000.00819.09
8.2.80.0000.00819.25
8.2.70.0060.00317.38
8.2.60.0050.00317.90
8.2.50.0050.00318.07
8.2.40.0000.00818.03
8.2.30.0050.00219.46
8.2.20.0080.00017.58
8.2.10.0000.00717.88
8.2.00.0060.00317.50
8.1.330.0120.00622.09
8.1.320.0140.00516.25
8.1.310.0070.01119.99
8.1.300.0090.00918.42
8.1.290.0090.00018.88
8.1.280.0120.00625.92
8.1.270.0030.00620.60
8.1.260.0050.00226.35
8.1.250.0090.00028.09
8.1.240.0040.00423.96
8.1.230.0070.00319.08
8.1.220.0030.00517.74
8.1.210.0080.00018.77
8.1.200.0000.00917.23
8.1.190.0000.00917.27
8.1.180.0040.00419.01
8.1.170.0040.00418.59
8.1.160.0040.00418.75
8.1.150.0070.00018.80
8.1.140.0050.00217.41
8.1.130.0000.00717.76
8.1.120.0030.00417.32
8.1.110.0070.00017.30
8.1.100.0060.00317.41
8.1.90.0000.00817.32
8.1.80.0040.00417.35
8.1.70.0000.00717.25
8.1.60.0000.00817.38
8.1.50.0000.00817.32
8.1.40.0000.00917.31
8.1.30.0040.00417.54
8.1.20.0030.00517.57
8.1.10.0060.00317.31
8.1.00.0000.01217.35
8.0.300.0070.00018.77
8.0.290.0040.00417.05
8.0.280.0050.00318.24
8.0.270.0040.00416.72
8.0.260.0000.00617.13
8.0.250.0030.00316.86
8.0.240.0030.00516.84
8.0.230.0000.00716.84
8.0.220.0040.00416.78
8.0.210.0000.00916.80
8.0.200.0000.00716.75
8.0.190.0030.00616.76
8.0.180.0070.00016.83
8.0.170.0000.00716.79
8.0.160.0050.00216.80
8.0.150.0070.00016.67
8.0.140.0050.00316.65
8.0.130.0000.00713.27
8.0.120.0000.00716.77
8.0.110.0050.00316.85
8.0.100.0000.00716.68
8.0.90.0070.00016.79
8.0.80.0000.01516.79
8.0.70.0000.00716.70
8.0.60.0040.00416.63
8.0.50.0000.00716.75
8.0.30.0120.01016.97
8.0.20.0100.01117.40
8.0.10.0040.00416.87
8.0.00.0090.00916.65
7.4.330.0050.00015.02
7.4.320.0030.00316.52
7.4.300.0030.00316.36
7.4.290.0070.00016.49
7.4.280.0030.00716.42
7.4.270.0030.00316.59
7.4.260.0070.00016.55
7.4.250.0050.00316.39
7.4.240.0040.00416.49
7.4.230.0000.00716.62
7.4.220.0100.01016.43
7.4.210.0070.01416.46
7.4.200.0040.00416.41
7.4.160.0100.00616.49
7.4.150.0170.00417.40
7.4.140.0140.00317.86
7.4.130.0130.00516.41
7.4.120.0090.01016.41
7.4.110.0100.00716.36
7.4.100.0090.00616.40
7.4.90.0110.00716.57
7.4.80.0060.01219.39
7.4.70.0060.00916.19
7.4.60.0130.01016.46
7.4.50.0030.00616.43
7.4.40.0130.01016.33
7.4.30.0110.01116.28
7.4.00.0070.01014.68
7.3.330.0000.00513.17
7.3.320.0000.00513.21
7.3.310.0030.00316.10
7.3.300.0000.00616.17
7.3.290.0050.01316.19
7.3.280.0060.00916.20
7.3.270.0060.01217.40
7.3.260.0130.00316.56
7.3.250.0060.01416.33
7.3.240.0080.00816.30
7.3.230.0100.00716.39
7.3.210.0070.01016.54
7.3.200.0110.01219.39
7.3.190.0070.01116.46
7.3.180.0080.00816.52
7.3.170.0120.00616.27
7.3.160.0050.01016.47
7.2.330.0030.01316.33
7.2.320.0150.00616.66
7.2.310.0040.01516.48
7.2.300.0060.01216.57
7.2.290.0080.00816.26
7.1.70.0100.00316.69
7.1.60.0070.01419.34
7.1.50.0070.01716.82
7.1.00.0000.08022.45
7.0.200.0000.01016.43
7.0.140.0000.04721.93
7.0.60.0170.05719.96
7.0.50.0000.04317.92
7.0.40.0030.07720.16
7.0.30.0230.04320.10
7.0.20.0170.04320.06
7.0.10.0130.08320.23
7.0.00.0100.06020.06
5.6.280.0030.07021.13
5.6.210.0230.06320.54
5.6.200.0130.07018.32
5.6.190.0000.08020.77
5.6.180.3830.04020.73
5.6.170.0300.05020.52
5.6.160.0100.08020.47
5.6.150.0100.03318.26
5.6.140.0100.08018.30
5.6.130.0130.06018.21
5.6.120.0070.04721.14
5.6.110.0100.03721.16
5.6.100.0100.08321.16
5.6.90.0100.08321.10
5.6.80.0100.06320.56
5.6.70.0370.06720.30
5.5.350.0430.06020.55
5.5.340.0030.08017.95
5.5.330.0000.05720.40
5.5.320.0200.04020.32
5.5.310.0270.08020.32
5.5.300.0100.08017.98
5.5.290.0100.07317.99
5.5.280.0100.08020.76
5.5.270.0170.06320.99
5.5.260.0030.04020.90
5.5.250.0130.08320.73
5.5.240.0270.07020.38
5.4.450.0070.06319.61
5.4.440.0870.05319.43
5.4.430.0170.05019.57
5.4.420.0100.06719.51
5.4.410.0200.06719.05
5.4.400.0100.06018.78
5.4.390.0170.04318.50
5.4.380.0230.04318.63
5.4.370.0000.06018.60
5.4.360.0070.05718.77
5.4.350.0170.02313.82
5.4.340.0070.03713.80
5.4.320.0030.04014.27
5.4.310.0000.04314.29
5.4.300.0030.04014.22
5.4.290.0070.03714.29
5.4.280.0070.03314.17
5.4.270.0070.03714.25
5.4.260.0070.04014.24
5.4.250.0070.03714.18
5.4.240.0170.02714.11
5.4.230.0130.03714.20
5.4.220.0200.02714.16
5.4.210.0030.04314.22
5.4.200.0070.04014.12
5.4.190.0070.03714.20
5.4.180.0100.03714.32
5.4.170.0230.03314.31
5.4.160.0070.04314.30
5.4.150.0070.04714.25
5.4.140.0200.04313.85
5.4.130.0130.03314.00
5.4.120.0070.04013.82
5.4.110.0070.03313.79
5.4.100.0030.04013.82
5.4.90.0100.03713.80
5.4.80.0200.02713.88
5.4.70.0070.03313.75
5.4.60.0070.03713.79
5.4.50.0070.03714.03
5.4.40.0030.04013.73
5.4.30.0230.03313.71
5.4.20.0130.04313.90
5.4.10.0070.04013.79
5.4.00.0030.05313.26
5.3.290.0030.04314.61
5.3.280.0070.03714.58
5.3.270.0030.04314.60
5.3.260.0030.04014.66
5.3.250.0030.04314.54
5.3.240.0100.03714.54
5.3.230.0030.04014.59
5.3.220.0030.04714.52
5.3.210.0000.06314.55
5.3.200.0030.05314.50
5.3.190.0070.04014.51
5.3.180.0070.03714.57
5.3.170.0030.04014.61
5.3.160.0170.04014.68
5.3.150.0030.04014.56
5.3.140.0100.03314.49
5.3.130.0100.04014.54
5.3.120.0070.04314.70
5.3.110.0100.04014.55
5.3.100.0030.04314.02
5.3.90.0070.03713.96
5.3.80.0170.02714.13
5.3.70.0100.03714.18
5.3.60.0170.03713.95
5.3.50.0170.03013.95
5.3.40.0100.04313.89
5.3.30.0130.03014.02
5.3.20.0100.03013.81
5.3.10.0000.04013.66
5.3.00.0030.05013.77
5.2.170.0100.02711.12
5.2.160.0070.03011.03
5.2.150.0070.03311.00
5.2.140.0100.03711.01
5.2.130.0030.03710.96
5.2.120.0030.03310.97
5.2.110.0100.03310.96
5.2.100.0070.04010.97
5.2.90.0130.02711.00
5.2.80.0030.03310.95
5.2.70.0100.03010.98
5.2.60.0030.03711.03
5.2.50.0030.03711.10
5.2.40.0030.03310.91
5.2.30.0070.03010.88
5.2.20.0100.03710.88
5.2.10.0100.02710.79
5.2.00.0100.03010.67
5.1.60.0130.03010.07
5.1.50.0000.0309.98
5.1.40.0070.02710.06
5.1.30.0030.03310.34
5.1.20.0070.02710.36
5.1.10.0170.0209.99
5.1.00.0000.03310.18
5.0.50.0070.0238.66
5.0.40.0070.0178.48
5.0.30.0030.0408.29
5.0.20.0030.0208.33
5.0.10.0070.0178.21
5.0.00.0030.0338.08
4.4.90.0000.0235.87
4.4.80.0000.0175.80
4.4.70.0070.0135.83
4.4.60.0000.0235.82
4.4.50.0000.0235.79
4.4.40.0070.0305.82
4.4.30.0030.0275.88
4.4.20.0030.0205.88
4.4.10.0030.0205.86
4.4.00.0030.0305.85
4.3.110.0030.0175.75
4.3.100.0000.0175.73
4.3.90.0070.0105.72
4.3.80.0000.0275.73
4.3.70.0000.0205.75
4.3.60.0000.0205.76
4.3.50.0000.0175.74
4.3.40.0030.0235.77
4.3.30.0070.0134.48
4.3.20.0070.0134.46
4.3.10.0000.0174.60
4.3.00.0000.0306.86

preferences:
30.05 ms | 403 KiB | 5 Q