3v4l.org

run code in 300+ PHP versions simultaneously
<?php class RPCInterface{ const STATUS_OK = 200; const STATUS_INVALID_CREDENTIALS = 401; const STATUS_RESSOURCE_NOT_FOUND = 404; const STATUS_INTERNAL_ERROR = 500; const STATUS_NOT_IMPLEMENTED = 501; const STATUS_SERVICE_UNAVAILABLE = 503; const ENCAP_RAW = 0; const ENCAP_AES256 = 1; const ENCAP_RSA2048 = 2; protected $encap = 0; public function getRequestStr($auth, $method, $data){ $req = new stdClass(); $req->auth = $auth; $req->method = $method; $req->data = $data; $reqStr = $this->encode($req); return $reqStr; } public function getResponse($respStr){ $resp = $this->decode($respStr); return $resp; } public function encode($obj){ $str = serialize($obj);// json_encode($str); $str = $this->encapsulate($str); return $str; } public function decode($str){ $str = $this->decapsulate($str); $obj = unserialize($str); return $obj; } public function encapsulate($str){ switch($this->encap){ case self::ENCAP_RAW: $str = base64_encode($str); break; case self::ENCAP_AES256: die('TODO IMPL AES245'); // TODO FIXME break; case self::ENCAP_RSA2048: die('TODO IMPL RSA2048'); // TODO FIXME break; default: die('UNKNOWN_ENCAP_ALG'); } return $str; } public function decapsulate($str){ switch($this->encap){ case self::ENCAP_RAW: $str = base64_decode($str); break; case self::ENCAP_AES256: die('TODO IMPL AES245'); // TODO FIXME break; case self::ENCAP_RSA2048: die('TODO IMPL RSA2048'); // TODO FIXME break; default: die('UNKNOWN_ENCAP_ALG'); } return $str; } public function responseOk($resp){ return ($resp->status == self::STATUS_OK); } public function getError($resp){ return $resp->data['error_num'].' '.$resp->data['error_msg']; } public function getErrorDesc($resp){ return $resp->data['error_desc']; } public function sendRequest($url, $auth, $method, $data){ $reqStr = $this->getRequestStr($auth, $method, $data); $request = xmlrpc_encode_request($method, $reqStr); // maybe do not use xmlrpc_ at all... $context = stream_context_create(array('http' => array( 'method' => "POST", 'header' => "Content-Type: text/xml", 'content' => $request ))); print_r($context); //$file = file_get_contents($url, false, $context); $resp = $this->getResponse($file); if($this->responseOk($resp)){ $resp->error = false; }else{ $resp->error = true; } return $resp; } } $rpc = new RPCInterface(); $auth = array(); $auth['customer_id'] = '4843929'; $auth['customer_pw'] = 'pw0rdRem0tE0815'; $auth['domain_id'] = '429'; $auth['domain_sec'] = 'a98bf32409cd1fd298e'; $method = 'status.ping'; $url = 'www.example.com'; $data = array(); $req = $rpc->getRequestStr($auth, $method, $data); $dec = $rpc->getResponse($req); echo $req; echo "\r\n"; echo print_r($dec, true); $resp = $rpc->sendRequest($url, $auth, $method, $data); if($resp->error){ echo "Error occured!\r\n"; } ?>

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.0110.01117.00
8.3.50.0090.00922.06
8.3.40.0060.01218.84
8.3.30.0140.00719.17
8.3.20.0050.00320.16
8.3.10.0080.00023.66
8.3.00.0080.00019.50
8.2.180.0130.00316.88
8.2.170.0110.00422.96
8.2.160.0120.00320.47
8.2.150.0040.00424.18
8.2.140.0000.00724.66
8.2.130.0080.00026.16
8.2.120.0040.00422.20
8.2.110.0090.00021.88
8.2.100.0040.00718.03
8.2.90.0050.00319.30
8.2.80.0040.00417.97
8.2.70.0000.00817.75
8.2.60.0080.00417.80
8.2.50.0030.00618.07
8.2.40.0000.00920.01
8.2.30.0000.00818.21
8.2.20.0040.00417.89
8.2.10.0040.00418.09
8.2.00.0040.00717.90
8.1.280.0180.00725.92
8.1.270.0000.00922.28
8.1.260.0000.00826.35
8.1.250.0050.00328.09
8.1.240.0030.00623.82
8.1.230.0000.01119.28
8.1.220.0030.00617.79
8.1.210.0000.00818.77
8.1.200.0030.00917.47
8.1.190.0040.00417.23
8.1.180.0080.00018.88
8.1.170.0030.00618.66
8.1.160.0060.00322.09
8.1.150.0040.00418.57
8.1.140.0050.00317.48
8.1.130.0000.00717.89
8.1.120.0070.00017.48
8.1.110.0060.00317.49
8.1.100.0050.00217.51
8.1.90.0050.00317.59
8.1.80.0000.00817.59
8.1.70.0070.00017.49
8.1.60.0060.00317.65
8.1.50.0040.00417.55
8.1.40.0030.00617.51
8.1.30.0080.00017.62
8.1.20.0000.00917.72
8.1.10.0040.00417.64
8.1.00.0040.00417.66
8.0.300.0040.00418.77
8.0.290.0070.00017.30
8.0.280.0040.00418.59
8.0.270.0050.00217.25
8.0.260.0040.00417.36
8.0.250.0080.00017.14
8.0.240.0000.00717.00
8.0.230.0040.00417.03
8.0.220.0040.00417.00
8.0.210.0030.00316.96
8.0.200.0060.00016.98
8.0.190.0000.00716.99
8.0.180.0000.00717.00
8.0.170.0000.00716.98
8.0.160.0030.00616.86
8.0.150.0080.00016.82
8.0.140.0000.00716.94
8.0.130.0000.00613.37
8.0.120.0030.00616.98
8.0.110.0030.00516.90
8.0.100.0000.00816.92
8.0.90.0000.00817.03
8.0.80.0120.00616.93
8.0.70.0030.00516.80
8.0.60.0040.00416.94
8.0.50.0040.00416.83
8.0.30.0100.01117.15
8.0.20.0090.01217.40
8.0.10.0040.00416.96
8.0.00.0100.00817.00
7.4.330.0000.00515.00
7.4.320.0000.00716.59
7.4.300.0000.00616.61
7.4.290.0050.00316.69
7.4.280.0060.00316.67
7.4.270.0000.00716.73
7.4.260.0070.00016.75
7.4.250.0050.00316.56
7.4.240.0040.00316.60
7.4.230.0070.00016.71
7.4.220.0160.00916.76
7.4.210.0130.00616.60
7.4.200.0000.00716.74
7.4.190.0000.00716.82
7.4.160.0080.00816.63
7.4.150.0090.00817.40
7.4.140.0090.00917.86
7.4.130.0050.01316.65
7.4.120.0060.01216.64
7.4.110.0120.00616.66
7.4.100.0100.01316.66
7.4.90.0080.01216.77
7.4.80.0120.01319.39
7.4.70.0050.01116.75
7.4.60.0140.00716.46
7.4.50.0000.00816.46
7.4.40.0070.01016.45
7.4.30.0120.00316.48
7.4.00.0030.01315.12
7.3.330.0030.00513.52
7.3.320.0000.00613.45
7.3.310.0040.00416.51
7.3.300.0030.00316.57
7.3.290.0090.00616.58
7.3.280.0080.01116.49
7.3.270.0140.00317.40
7.3.260.0140.00916.44
7.3.250.0120.01116.55
7.3.240.0130.00316.59
7.3.230.0070.01016.40
7.3.210.0130.00316.45
7.3.200.0090.00919.39
7.3.190.0030.01316.45
7.3.180.0100.00716.65
7.3.170.0060.00916.58
7.3.160.0040.01216.61
7.3.120.0040.01115.04
7.3.10.0060.00916.63
7.3.00.0060.00716.69
7.2.330.0040.01316.54
7.2.320.0130.00916.44
7.2.310.0030.01516.88
7.2.300.0140.00316.79
7.2.290.0120.00816.63
7.2.130.0070.01116.92
7.2.120.0100.00616.75
7.2.110.0100.00616.91
7.2.100.0110.00816.79
7.2.90.0110.00416.75
7.2.80.0040.01216.86
7.2.70.0040.00916.92
7.2.60.0080.00817.05
7.2.50.0100.00816.72
7.2.40.0080.00617.09
7.2.30.0080.01116.83
7.2.20.0100.00616.85
7.2.10.0030.01216.83
7.2.00.0050.00817.73
7.1.250.0080.00815.86
7.1.240.0090.00915.51
7.1.230.0120.00815.66
7.1.220.0110.00715.65
7.1.210.0070.01115.51
7.1.200.0070.00815.58
7.1.190.0070.01315.74
7.1.180.0130.00815.41
7.1.170.0180.00015.58
7.1.160.0150.00415.48
7.1.150.0130.01015.60
7.1.140.0140.00315.61
7.1.130.0140.00315.68
7.1.120.0040.01515.66
7.1.110.0140.00315.68
7.1.100.0070.00716.88
7.1.90.0140.00315.47
7.1.80.0160.00615.75
7.1.70.0130.00216.62
7.1.60.0110.00817.67
7.1.50.0090.00416.48
7.1.40.0030.01315.63
7.1.30.0110.00715.80
7.1.20.0100.01015.78
7.1.10.0070.01015.50
7.1.00.0140.04319.11
7.0.330.0190.00015.10
7.0.320.0120.00415.28
7.0.310.0170.00315.29
7.0.300.0140.00815.17
7.0.290.0120.00815.07
7.0.280.0120.00515.27
7.0.270.0100.00814.84
7.0.260.0100.00715.25
7.0.250.0050.01415.45
7.0.240.0070.01115.13
7.0.230.0160.00415.24
7.0.220.0120.00515.51
7.0.210.0090.01015.20
7.0.200.0110.00115.97
7.0.190.0140.00515.21
7.0.180.0130.00615.43
7.0.170.0100.01315.39
7.0.160.0080.01115.32
7.0.150.0060.01215.43
7.0.140.0050.04018.78
7.0.130.0190.00015.40
7.0.120.0100.01015.32
7.0.110.0110.00315.28
7.0.100.0080.00815.31
7.0.90.0120.00615.24
7.0.80.0130.00615.51
7.0.70.0090.02218.38
7.0.60.0090.03018.26
7.0.50.0040.03818.74
7.0.40.0070.02916.58
7.0.30.0050.02716.71
7.0.20.0090.02816.77
7.0.10.0020.02616.71
7.0.00.0020.04816.81
5.6.380.0090.00314.58
5.6.370.0060.01214.20
5.6.360.0070.00514.66
5.6.350.0000.01314.35
5.6.340.0070.01014.75
5.6.330.0070.00814.73
5.6.320.0040.01314.71
5.6.310.0110.00314.81
5.6.300.0080.00814.22
5.6.290.0060.01014.39
5.6.280.0020.04317.72
5.6.270.0080.00514.20
5.6.260.0060.00614.43
5.6.250.0040.00914.44
5.6.240.0080.01014.48
5.6.230.0080.01214.50
5.6.220.0060.02417.50
5.6.210.0040.02517.59
5.6.200.0160.03817.79
5.6.190.0100.02217.51
5.6.180.0020.04717.55
5.6.170.0000.02717.73
5.6.160.0030.03117.59
5.6.150.0050.04617.70
5.6.140.0050.03717.69
5.6.130.0050.02417.63
5.6.120.0080.03517.83
5.6.110.0000.03017.75
5.6.100.0100.04117.57
5.6.90.0050.02517.71
5.6.80.0030.02517.35
5.6.70.0060.02617.40
5.6.60.0110.02317.49
5.6.50.0090.02217.35
5.6.40.0030.02617.43
5.6.30.0020.02217.52
5.6.20.0030.02317.39
5.6.10.0030.02017.28
5.6.00.0020.02217.44
5.5.380.0090.00311.28
5.5.370.0000.01311.43
5.5.360.0020.02015.73
5.5.350.0040.04415.87
5.5.340.0020.02316.01
5.5.330.0040.04415.80
5.5.320.0030.02815.87
5.5.310.0090.03316.16
5.5.300.0060.04116.23
5.5.290.0050.02316.22
5.5.280.0060.04016.02
5.5.270.0080.02816.07
5.5.260.0070.04316.13
5.5.250.0080.04015.83
5.5.240.0040.02015.86
5.5.230.0040.01915.84
5.5.220.0060.01715.61
5.5.210.0030.01815.67
5.5.200.0050.01815.68
5.5.190.0050.02315.62
5.5.180.0080.01515.77
5.5.170.0040.00411.21
5.5.160.0080.02515.75
5.5.150.0010.02415.66
5.5.140.0050.02315.52
5.5.130.0070.01815.69
5.5.120.0030.02315.65
5.5.110.0060.03315.64
5.5.100.0050.02815.64
5.5.90.0030.02315.65
5.5.80.0030.02415.63
5.5.70.0030.02515.68
5.5.60.0030.02715.55
5.5.50.0000.02515.56
5.5.40.0080.01515.71
5.5.30.0040.02215.70
5.5.20.0050.01915.73
5.5.10.0040.02115.54
5.5.00.0020.02115.46
5.4.450.0070.02115.29
5.4.440.0020.04415.33
5.4.430.0050.03715.22
5.4.420.0040.02515.27
5.4.410.0070.02715.20
5.4.400.0060.03315.06
5.4.390.0020.02014.98
5.4.380.0030.03015.06
5.4.370.0030.01714.89
5.4.360.0070.02914.92
5.4.350.0040.02115.20
5.4.340.0020.02715.16
5.4.330.0120.00011.20
5.4.320.0030.03915.10
5.4.310.0070.02314.97
5.4.300.0030.03715.18
5.4.290.0050.02015.06
5.4.280.0000.02614.94
5.4.270.0100.02815.16
5.4.260.0080.03315.14
5.4.250.0060.02015.17
5.4.240.0080.01915.13
5.4.230.0040.02415.21
5.4.220.0040.02315.21
5.4.210.0060.02215.20
5.4.200.0040.01915.21
5.4.190.0100.01815.11
5.4.180.0060.02014.88
5.4.170.0100.01515.19
5.4.160.0040.01714.89
5.4.150.0040.02015.07
5.4.140.0050.01913.82
5.4.130.0050.02013.87
5.4.120.0100.01513.82
5.4.110.0070.01613.80
5.4.100.0030.02213.91
5.4.90.0020.02213.70
5.4.80.0040.01713.65
5.4.70.0020.01913.75
5.4.60.0020.01813.73
5.4.50.0040.01813.55
5.4.40.0030.01913.66
5.4.30.0050.01813.83
5.4.20.0000.02213.89
5.4.10.0050.01813.82
5.4.00.0050.01713.60
5.3.290.0040.02112.73
5.3.280.0030.02312.55
5.3.270.0000.02212.78
5.3.260.0060.01712.69
5.3.250.0040.01612.62
5.3.240.0060.02012.60
5.3.230.0050.01712.59
5.3.220.0060.01612.63
5.3.210.0000.02012.60
5.3.200.0030.02012.61
5.3.190.0030.01812.61
5.3.180.0040.01812.74
5.3.170.0050.01512.65
5.3.160.0000.02112.78
5.3.150.0020.01812.63
5.3.140.0030.02312.80
5.3.130.0050.01812.66
5.3.120.0050.01812.77
5.3.110.0050.01912.69
5.3.100.0000.02012.44
5.3.90.0070.01512.51
5.3.80.0050.01612.33
5.3.70.0030.02012.30
5.3.60.0070.01812.16
5.3.50.0030.02012.34
5.3.40.0040.01812.23
5.3.30.0060.01712.34
5.3.20.0040.01612.11
5.3.10.0070.01512.06
5.3.00.0030.01811.94
5.2.170.0070.01210.43
5.2.160.0040.01410.43
5.2.150.0040.01410.38
5.2.140.0040.01410.44
5.2.130.0070.01110.27
5.2.120.0060.01410.49
5.2.110.0000.01910.40
5.2.100.0060.01610.32
5.2.90.0040.01410.40
5.2.80.0030.01610.23
5.2.70.0020.01410.40
5.2.60.0070.01710.25
5.2.50.0030.02010.29
5.2.40.0040.01310.25
5.2.30.0030.01510.29
5.2.20.0030.01910.24
5.2.10.0080.01810.21
5.2.00.0040.03310.09
5.1.60.0060.0209.77
5.1.50.0010.0139.72
5.1.40.0040.0279.76
5.1.30.0040.0239.84
5.1.20.0040.0189.93
5.1.10.0040.0309.77
5.1.00.0010.0189.82
5.0.50.0020.0249.04
5.0.40.0030.0109.04
5.0.30.0020.0279.04
5.0.20.0050.0179.04
5.0.10.0000.0179.04
5.0.00.0010.0199.04
4.4.90.0040.0089.04
4.4.80.0030.0099.04
4.4.70.0000.0119.04
4.4.60.0000.0109.04
4.4.50.0020.0109.04
4.4.40.0030.0209.04
4.4.30.0020.0169.04
4.4.20.0020.0129.04
4.4.10.0000.0119.04
4.4.00.0030.0209.04
4.3.110.0000.0229.04
4.3.100.0020.0109.04
4.3.90.0020.0179.04
4.3.80.0010.0289.04
4.3.70.0030.0139.04
4.3.60.0020.0119.04
4.3.50.0000.0209.04
4.3.40.0000.0219.04
4.3.30.0030.0109.04
4.3.20.0020.0109.04
4.3.10.0020.0089.04
4.3.00.0020.0109.04

preferences:
40.21 ms | 401 KiB | 5 Q