3v4l.org

run code in 300+ PHP versions simultaneously
<pre> <?php $user = "<username>"; $password = "<password>"; $cameraid = "<camera id>"; //authentification $response = get_web_page("http://diskstation:5000/webapi/auth.cgi?api=SYNO.API.Auth&method=Login&version=2&account=". $user."&passwd=".$password."&session=SurveillanceStation&format=sid"); //echo $response; $resArr = array(); $resArr = ($response); $resArr = json_decode($response,true); //sid in the array $sid=array(); $sid=$resArr[data]; //echo $sid[sid]; //Request API info: //http://diskstation:5000/webapi/query.cgi?api=SYNO.API.Info&method=Query&version=1&query=SYNO.SurveillanceStation.ExternalRecording //List camera's to find camera ID: //http://diskstation:5000/webapi/_______________________________________________________entry.cgi?api=SYNO.SurveillanceStation.Camera&method=List&version=1&offset=1&limit=30&sid=<sid> //look for: "id": //send Start record $url="http://diskstation:5000/webapi/_______________________________________________________entry.cgi?api=SYNO.SurveillanceStation.ExternalRecording&method=Record&version=2&cameraId=". $cameraid. "&_sid=".$sid[sid]."&action="; //echo 'url: '.$url.'<br />'; $response = get_web_page($url.'start'); sleep(10); $response = get_web_page($url.'stop'); function get_web_page($url) { $options = array (CURLOPT_RETURNTRANSFER => true, // return web page CURLOPT_HEADER => false, // don't return headers CURLOPT_FOLLOWLOCATION => true, // follow redirects CURLOPT_ENCODING => "", // handle compressed CURLOPT_USERAGENT => "test", // who am i CURLOPT_AUTOREFERER => true, // set referer on redirect CURLOPT_CONNECTTIMEOUT => 120, // timeout on connect CURLOPT_TIMEOUT => 120, // timeout on response CURLOPT_MAXREDIRS => 10 ); // stop after 10 redirects $ch = curl_init ( $url ); curl_setopt_array ( $ch, $options ); $content = curl_exec ( $ch ); $err = curl_errno ( $ch ); $errmsg = curl_error ( $ch ); $header = curl_getinfo ( $ch ); $httpCode = curl_getinfo ( $ch, CURLINFO_HTTP_CODE ); curl_close ( $ch ); $header ['errno'] = $err; $header ['errmsg'] = $errmsg; $header ['content'] = $content; echo 'response:<br />'.$content.'<br />'; return $header ['content']; } ?> </pre>

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.70.0040.01416.63
8.3.60.0090.00918.68
8.3.50.0140.00722.96
8.3.40.0120.00318.74
8.3.30.0040.01118.85
8.3.20.0090.00620.29
8.3.10.0080.00421.64
8.3.00.0060.00319.68
8.2.190.0040.01218.36
8.2.180.0140.00718.43
8.2.170.0100.01022.96
8.2.160.0040.01119.16
8.2.150.0070.01124.18
8.2.140.0080.00024.66
8.2.130.0160.00326.16
8.2.120.0070.00320.53
8.2.110.0170.00019.27
8.2.100.0040.00717.84
8.2.90.0040.00417.84
8.2.80.0090.00218.97
8.2.70.0000.00917.63
8.2.60.0040.00417.50
8.2.50.0030.00517.93
8.2.40.0040.00421.02
8.2.30.0000.00819.95
8.2.20.0040.00417.88
8.2.10.0000.00718.16
8.2.00.0070.00318.03
8.1.280.0070.01025.92
8.1.270.0090.00623.92
8.1.260.0040.00426.35
8.1.250.0040.01428.09
8.1.240.0060.00319.54
8.1.230.0040.00720.91
8.1.220.0000.00817.79
8.1.210.0030.00518.97
8.1.200.0060.00317.35
8.1.190.0000.00817.36
8.1.180.0050.00519.01
8.1.170.0040.00417.62
8.1.160.0050.00518.88
8.1.150.0070.00018.92
8.1.140.0030.00519.61
8.1.130.0030.00519.22
8.1.120.0000.00717.53
8.1.110.0000.00817.45
8.1.100.0070.00017.48
8.1.90.0000.00717.51
8.1.80.0000.00717.51
8.1.70.0000.00717.45
8.1.60.0000.00817.52
8.1.50.0030.00517.45
8.1.40.0040.00417.52
8.1.30.0000.00817.61
8.1.20.0080.00017.69
8.1.10.0030.00517.60
8.1.00.0100.00317.55
8.0.300.0020.00520.16
8.0.290.0000.00916.75
8.0.280.0050.00318.53
8.0.270.0000.00816.90
8.0.260.0040.00416.92
8.0.250.0030.00317.06
8.0.240.0070.00016.93
8.0.230.0090.00016.98
8.0.220.0000.00716.98
8.0.210.0000.00916.96
8.0.200.0030.00317.02
8.0.190.0060.00317.04
8.0.180.0040.00317.01
8.0.170.0080.00016.92
8.0.160.0000.00916.98
8.0.150.0040.00416.82
8.0.140.0070.00016.94
8.0.130.0050.00213.43
8.0.120.0040.00416.96
8.0.110.0000.00716.99
8.0.100.0070.00016.84
8.0.90.0000.00816.97
8.0.80.0060.01517.02
8.0.70.0040.00416.88
8.0.60.0050.00216.84
8.0.50.0000.00716.89
8.0.30.0090.00717.07
8.0.20.0120.00717.41
8.0.10.0030.00517.22
8.0.00.0110.00716.66
7.4.330.0000.00515.08
7.4.320.0000.00616.64
7.4.300.0090.00016.66
7.4.290.0000.00716.52
7.4.280.0040.00416.61
7.4.270.0030.00316.53
7.4.260.0030.00316.57
7.4.250.0040.00416.45
7.4.240.0040.00416.62
7.4.230.0040.00416.43
7.4.220.0130.00616.73
7.4.210.0060.00916.65
7.4.200.0030.00316.56
7.4.160.0100.01016.50
7.4.150.0110.00617.40
7.4.140.0100.01117.86
7.4.130.0120.00716.39
7.4.120.0130.00416.69
7.4.110.0100.01016.64
7.4.100.0040.01316.48
7.4.90.0090.01316.56
7.4.80.0120.00619.39
7.4.70.0080.00816.52
7.4.60.0070.01016.32
7.4.50.0030.00716.60
7.4.40.0100.00716.61
7.4.30.0040.01316.64
7.3.330.0050.00313.40
7.3.320.0050.00013.41
7.3.310.0030.00316.50
7.3.300.0040.00416.40
7.3.290.0070.00716.29
7.3.280.0110.00716.44
7.3.270.0170.00817.40
7.3.260.0060.01116.41
7.3.250.0090.01116.46
7.3.240.0140.00616.45
7.3.230.0030.01516.53
7.3.210.0070.01016.39
7.3.200.0100.01016.48
7.3.190.0120.00916.44
7.3.180.0180.00016.40
7.3.170.0110.00616.49
7.3.160.0080.00816.45
7.2.330.0070.01116.46
7.2.320.0090.01216.70
7.2.310.0080.01416.76
7.2.300.0070.01316.68
7.2.290.0060.01116.75
7.0.70.0670.06320.02
7.0.60.0730.05319.98
7.0.50.0970.06720.41
7.0.40.0800.05320.37
7.0.30.0730.05720.33
7.0.20.0770.06320.39
7.0.10.0600.07020.43
7.0.00.0730.06320.36
5.6.220.0630.06020.61
5.6.210.0630.05720.57
5.6.200.0630.06021.16
5.6.190.0800.07021.13
5.6.180.0570.06321.08
5.6.170.0670.05321.02
5.6.160.0770.04021.14
5.6.150.0600.07021.16
5.6.140.0630.06021.19
5.6.130.0570.06321.18
5.6.120.0100.06021.18
5.6.110.0500.05721.06
5.6.100.0670.05721.07
5.6.90.0730.06021.09
5.6.80.0600.06020.48
5.6.70.0770.07720.53
5.6.60.0800.07720.51
5.6.50.0630.05720.56
5.6.40.0900.07020.47
5.6.30.0800.06320.43
5.6.20.0670.05320.45
5.6.10.0700.05020.45
5.6.00.0700.05020.55
5.5.360.0630.05320.43
5.5.350.0700.04720.34
5.5.340.0730.04720.86
5.5.330.0630.05720.86
5.5.320.0570.06020.96
5.5.310.0730.04720.95
5.5.300.0630.06720.88
5.5.290.0730.05020.99
5.5.280.0130.06320.89
5.5.270.0730.07320.91
5.5.260.0700.06020.93
5.5.250.0870.04320.77
5.5.240.0600.07020.37
5.5.230.0570.06720.35
5.5.220.0800.05720.34
5.5.210.0630.07320.11
5.5.200.0800.07720.05
5.5.190.0670.06320.20
5.5.180.0670.05320.23
5.5.160.0600.05720.23
5.5.150.0630.05320.32
5.5.140.0700.05020.29
5.5.130.0630.04720.30
5.5.120.0670.05320.21
5.5.110.0600.05320.30
5.5.100.0630.05320.20
5.5.90.0630.06020.15
5.5.80.0700.05020.23
5.5.70.0570.06320.11
5.5.60.0670.05320.24
5.5.50.0670.06020.14
5.5.40.0630.05720.08
5.5.30.0670.06320.02
5.5.20.0730.05020.17
5.5.10.0670.06020.12
5.5.00.0700.07020.20

preferences:
50.15 ms | 401 KiB | 5 Q