3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * Send a POST requst using cURL * @param string $url to request * @param array $post values to send * @param array $options for cURL * @return string */ function curl_post($url, array $post = NULL) { $defaults = array( CURLOPT_POST => 1, CURLOPT_HEADER => 0, CURLOPT_URL => $url, CURLOPT_FRESH_CONNECT => 1, CURLOPT_RETURNTRANSFER => 1, CURLOPT_FORBID_REUSE => 1, CURLOPT_TIMEOUT => 4, CURLOPT_POSTFIELDS => http_build_query($post) ); $ch = curl_init(); curl_setopt_array($ch, ($defaults)); if( ! $result = curl_exec($ch)) { trigger_error(curl_error($ch)); } curl_close($ch); return $result; } $ul = "http://localhost:8080/admin-app/service/sites/1/providers"; $reopt = array(); $postdata = array('key' => 'jHsYiWWRZDq5Sq3N'); $resp = curl_post($ul, $postdata, $reopt); ?>
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught Error: Undefined constant "CURLOPT_POST" in /in/6IWfF:12 Stack trace: #0 /in/6IWfF(35): curl_post('http://localhos...', Array, Array) #1 {main} thrown in /in/6IWfF on line 12
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:
44.59 ms | 401 KiB | 8 Q