3v4l.org

run code in 300+ PHP versions simultaneously
<?php function doHttpRequest($url, $post_data = NULL, $method = 'GET',) { $ch = curl_init(); $options = array( CURLOPT_URL => $url, CURLOPT_RETURNTRANSFER => TRUE, CURLOPT_HEADER => FALSE, CURLOPT_CUSTOMREQUEST => $method ); if (isset($post_data)){ if($method == "POST") { $options[CURLOPT_POST] = TRUE; $options[CURLOPT_POSTFIELDS] = $post_data; } else { $options[CURLOPT_URL] = $url .'?'. http_build_query($post_data,'','&'); } } curl_setopt_array($ch, $options); $response = curl_exec($ch); curl_close($ch); return $response; } $post_data = array( 'apiKey' => 'bbd9f56b9ec239745931df1026baee74', 'campaign' => '4732' ); $data = doHttpRequest('http://theappreciationengine.com/api/top',$post_data); ?>
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught Error: Call to undefined function curl_init() in /in/SHl7L:3 Stack trace: #0 /in/SHl7L(27): doHttpRequest('http://theappre...', Array) #1 {main} thrown in /in/SHl7L on line 3
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:
37.69 ms | 401 KiB | 8 Q