3v4l.org

run code in 300+ PHP versions simultaneously
<?php $apiKey = 'AIzaSyBQ37DWAUJrJhwU2_vlzkT7yklAUoUQ8q4'; //Get API key from : http://code.google.com/apis/console/ $postData = array('longUrl' => "notelr.com/VladVidican", 'key' => $apiKey); $jsonData = json_encode($postData); $curlObj = curl_init(); curl_setopt($curlObj, CURLOPT_URL, 'https://www.googleapis.com/urlshortener/v1/url'); curl_setopt($curlObj, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curlObj, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($curlObj, CURLOPT_HEADER, 0); curl_setopt($curlObj, CURLOPT_HTTPHEADER, array('Content-type:application/json')); curl_setopt($curlObj, CURLOPT_POST, 1); curl_setopt($curlObj, CURLOPT_POSTFIELDS, $jsonData); $response = curl_exec($curlObj); //change the response json string to object $json = json_decode($response); curl_close($curlObj); echo $json->id;
Output for git.master_jit, git.master, rfc.property-hooks
Fatal error: Uncaught Error: Call to undefined function curl_init() in /in/hFuEs:8 Stack trace: #0 {main} thrown in /in/hFuEs on line 8
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
45.84 ms | 401 KiB | 8 Q