3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $data = array('users'=>array( array( 'username'=>'testusername1', 'password'=>'testpassword1', 'firstname'=>'test', 'lastname'=>'user', 'email'=>'testusername@fakemail.com' ) )); $ch = curl_init("http://vps02.ouhk.edu.hk/~qess/webservice/rest/server.php?wstoken=f4dfb904d79777f22cafe3c7472b744c&wsfunction=core_user_create_users&moodlewsrestformat=json"); curl_setopt_array($ch,array( CURLOPT_RETURNTRANSFER => true, // return web page CURLOPT_HEADER => false, // don't return headers CURLOPT_ENCODING => "", // handle all encodings CURLOPT_USERAGENT => "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36", // 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 CURLOPT_POST => true, // i am sending post data CURLOPT_POSTFIELDS => http_build_query($data), // this are my post vars CURLOPT_SSL_VERIFYHOST => 0, // don't verify ssl CURLOPT_SSL_VERIFYPEER => false, // CURLOPT_VERBOSE => 1 // )); var_dump(curl_exec($ch));
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught Error: Call to undefined function curl_init() in /in/XO6aN:12 Stack trace: #0 {main} thrown in /in/XO6aN on line 12
Process exited with code 255.
Output for 5.3.20 - 5.6.28
Fatal error: Call to undefined function curl_init() in /in/XO6aN on line 12
Process exited with code 255.