3v4l.org

run code in 300+ PHP versions simultaneously
<?php class JsonRpcFault extends Exception {} class JsonRpcClient { private $uri; public function __construct($uri) { $this->uri = $uri; } private function generateId() { $chars = array_merge(range('A', 'Z'), range('a', 'z'), range(0, 9)); $id = ''; for($c = 0; $c < 16; ++$c) $id .= $chars[mt_rand(0, count($chars) - 1)]; return $id; } public function __call($name, $arguments) { $id = $this->generateId(); $request = array( 'jsonrpc' => '2.0', 'method' => $name, 'params' => $arguments, 'id' => $id ); $jsonRequest = json_encode($request); $ctx = stream_context_create(array( 'http' => array( 'method' => 'POST', 'header' => 'Content-Type: application/json\r\n', 'content' => $jsonRequest ) )); $jsonResponse = file_get_contents($this->uri, false, $ctx); if ($jsonResponse === false) throw new JsonRpcFault('file_get_contents failed', -32603); $response = json_decode($jsonResponse); if ($response === null) throw new JsonRpcFault('JSON cannot be decoded', -32603); if ($response->id != $id) throw new JsonRpcFault('Mismatched JSON-RPC IDs', -32603); if (property_exists($response, 'error')) throw new JsonRpcFault($response->error->message, $response->error->code); else if (property_exists($response, 'result')) return $response->result; else throw new JsonRpcFault('Invalid JSON-RPC response', -32603); } } ?>

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)
7.3.120.0030.01314.71
7.3.110.0000.01414.82
7.3.100.0120.00314.71
7.3.90.0090.00614.88
7.3.80.0040.01114.66
7.3.70.0150.00014.73
7.3.60.0100.00314.68
7.3.50.0070.01014.74
7.3.40.0070.01014.74
7.3.30.0090.00614.63
7.3.20.0070.01016.57
7.3.10.0090.00316.63
7.3.00.0030.00916.65
7.2.240.0000.01515.05
7.2.230.0030.01014.86
7.2.220.0030.01214.54
7.2.210.0030.01114.57
7.2.200.0060.00914.96
7.2.190.0070.00314.83
7.2.180.0030.01414.93
7.2.170.0040.01214.86
7.2.160.0060.00914.65
7.2.150.0040.01416.66
7.2.140.0070.01016.88
7.2.130.0050.01016.65
7.2.120.0030.01016.72
7.2.110.0070.00716.67
7.2.100.0080.00516.72
7.2.90.0130.00316.80
7.2.80.0020.00916.76
7.2.70.0100.00316.70
7.2.60.0060.00616.69
7.2.50.0040.00716.70
7.2.40.0090.00516.70
7.2.30.0090.00516.79
7.2.20.0080.00516.62
7.2.10.0080.00516.71
7.2.00.0060.00717.42
7.1.330.0070.01015.72
7.1.320.0110.00315.66
7.1.310.0060.00615.55
7.1.300.0030.00915.57
7.1.290.0000.01115.48
7.1.280.0070.01015.76
7.1.270.0100.00615.66
7.1.260.0060.00915.64
7.1.250.0070.00715.57
7.1.100.0160.00017.59
7.1.70.0040.00416.84
7.1.60.0100.01419.86
7.1.50.0070.01716.90
7.1.00.0030.07722.37
7.0.200.0490.01314.89
7.0.90.0570.04320.01
7.0.80.0530.07720.00
7.0.70.0530.05719.89
7.0.60.0500.05020.01
7.0.50.0600.08020.30
7.0.40.0130.04020.11
7.0.30.0030.08319.95
7.0.20.0070.04720.02
7.0.10.0100.06020.10
7.0.00.0100.07319.99
5.6.280.0130.06021.14
5.6.240.0130.07720.69
5.6.230.0000.08720.62
5.6.220.0070.08020.67
5.6.210.0070.08720.63
5.6.200.0070.08321.14
5.6.190.0000.08020.96
5.6.180.0130.07321.20
5.6.170.0070.08021.11
5.6.160.0170.06320.98
5.6.150.0030.05321.20
5.6.140.0170.07021.07
5.6.130.0100.08021.03
5.6.120.0170.05320.98
5.6.110.0100.04021.07
5.6.100.0070.04321.06
5.6.90.0200.07321.02
5.6.80.0070.07720.44
5.6.70.0030.07320.46
5.6.60.0270.06020.47
5.6.50.0030.05720.42
5.6.40.0070.04320.31
5.6.30.0030.04020.43
5.6.20.0030.04020.38
5.6.10.0170.07720.31
5.6.00.0130.07720.48
5.5.380.0100.08020.39
5.5.370.0170.07720.38
5.5.360.0170.08020.38
5.5.350.0200.06720.46
5.5.340.0070.07320.82
5.5.330.0030.07020.82
5.5.320.0100.08020.94
5.5.310.0070.07720.92
5.5.300.0100.08020.78
5.5.290.0170.07320.91
5.5.280.0100.07020.84
5.5.270.0000.05320.84
5.5.260.0130.04320.84
5.5.250.0130.05720.66
5.5.240.0070.05320.29
5.5.230.0100.04020.33
5.5.220.0070.04720.30
5.5.210.0100.05720.27
5.5.200.0100.05320.24
5.5.190.0130.07320.16
5.5.180.0100.05720.24
5.5.160.0070.05020.30
5.5.150.0200.06320.15
5.5.140.0100.07320.26
5.5.130.0070.08720.11
5.5.120.0100.05320.14
5.5.110.0030.05320.28
5.5.100.0170.07020.18
5.5.90.0100.07020.14
5.5.80.0130.06320.07
5.5.70.0070.05720.14
5.5.60.0030.07020.12
5.5.50.0100.04720.17
5.5.40.0130.04720.16
5.5.30.0070.07720.18
5.5.20.0100.05019.98
5.5.10.0030.04720.09
5.5.00.0000.04320.15
5.4.450.0070.07019.50
5.4.440.0070.08719.36
5.4.430.0000.04319.36
5.4.420.0130.06319.50
5.4.410.0030.07319.25
5.4.400.0070.03719.05
5.4.390.0030.04019.05
5.4.380.0070.03719.04
5.4.370.0030.08018.90
5.4.360.0070.08019.14
5.4.350.0030.04019.21
5.4.340.0070.04319.03
5.4.320.0100.05319.04
5.4.310.0230.06019.09
5.4.300.0030.08019.18
5.4.290.0070.07719.14
5.4.280.0030.08319.18
5.4.270.0070.07318.87
5.4.260.0170.06719.02
5.4.250.0100.07318.86
5.4.240.0130.06719.17
5.4.230.0100.07319.03
5.4.220.0070.07319.02
5.4.210.0070.07318.93
5.4.200.0100.06019.20
5.4.190.0030.08019.02
5.4.180.0070.08019.22
5.4.170.0070.06018.94
5.4.160.0030.04018.92
5.4.150.0030.04018.87
5.4.140.0030.05016.26
5.4.130.0030.03316.45
5.4.120.0030.03316.49
5.4.110.0100.02716.48
5.4.100.0000.04016.54
5.4.90.0000.03716.47
5.4.80.0000.03316.48
5.4.70.0000.03716.43
5.4.60.0000.03716.41
5.4.50.0000.03716.48
5.4.40.0130.06316.37
5.4.30.0070.04316.43
5.4.20.0000.03716.48
5.4.10.0030.04016.43
5.4.00.0030.04015.81
5.3.290.0030.07714.75
5.3.280.0230.04714.67
5.3.270.0030.04314.65
5.3.260.0070.03714.69
5.3.250.0100.04314.73
5.3.240.0030.03714.71
5.3.230.0030.03714.71
5.3.220.0100.02714.54
5.3.210.0070.03314.64
5.3.200.0030.03714.64
5.3.190.0000.04014.58
5.3.180.0070.06014.68
5.3.170.0070.03314.57
5.3.160.0000.06014.72
5.3.150.0030.03714.57
5.3.140.0030.04314.51
5.3.130.0030.04014.70
5.3.120.0070.03714.56
5.3.110.0030.04014.66
5.3.100.0070.06314.02
5.3.90.0100.05714.02
5.3.80.0000.04313.97
5.3.70.0030.03014.13
5.3.60.0030.03714.16
5.3.50.0030.03713.96
5.3.40.0070.03313.89
5.3.30.0030.04313.99
5.3.20.0000.03713.77
5.3.10.0000.04013.66
5.3.00.0000.03313.68
5.2.170.0000.03011.18
5.2.160.0030.02311.10
5.2.150.0030.03011.30
5.2.140.0030.02711.27
5.2.130.0030.02711.03
5.2.120.0030.02311.18
5.2.110.0000.03011.18
5.2.100.0100.01711.18
5.2.90.0030.02711.27
5.2.80.0070.02711.00
5.2.70.0070.02311.18
5.2.60.0030.02711.00
5.2.50.0100.04011.14
5.2.40.0070.02711.06
5.2.30.0000.03310.88
5.2.20.0070.02311.04
5.2.10.0000.03010.80
5.2.00.0030.02710.79
5.1.60.0030.02310.07
5.1.50.0030.02310.02
5.1.40.0000.02710.00
5.1.30.0070.02010.33
5.1.20.0030.02710.25
5.1.10.0030.02010.19
5.1.00.0100.01310.18
5.0.50.0000.0238.66
5.0.40.0000.0378.49
5.0.30.0000.0308.32
5.0.20.0000.0208.31
5.0.10.0030.0278.19
5.0.00.0030.0278.26
4.4.90.0000.0176.99
4.4.80.0000.0176.99
4.4.70.0030.0136.99
4.4.60.0030.0136.99
4.4.50.0030.0136.99
4.4.40.0000.0236.99
4.4.30.0000.0176.99
4.4.20.0000.0176.99
4.4.10.0000.0176.99
4.4.00.0000.0276.99
4.3.110.0000.0176.99
4.3.100.0000.0136.99
4.3.90.0000.0176.99
4.3.80.0000.0236.99
4.3.70.0000.0136.99
4.3.60.0070.0136.99
4.3.50.0000.0176.99
4.3.40.0000.0506.99
4.3.30.0000.0376.99
4.3.20.0000.0306.99
4.3.10.0030.0206.99
4.3.00.0000.0376.99

preferences:
40.3 ms | 400 KiB | 5 Q