run code in 300+ PHP versions simultaneously
<?php //Enter your code here, enjoy! class ICObenchAPI { private $privateKey = '196c979a-e3a5-40cc-8bf8-55edbb4af14b'; private $publicKey = '570d742e-21c0-4a8b-9f13-fbc30f00b804'; private $apiUrl = 'https://icobench.com/api/v1/'; public $result; public function getICOs($type = 'all', $data = ''){ return $this->send('icos/' . $type, $data); } public function getICO($icoId, $data = ''){ return $this->send('ico/' . $icoId, $data); } public function getOther($type){ return $this->send('other/' . $type, ''); } private function send($action, $data){ $dataJson = json_encode($data); echo $sig = base64_encode(hash_hmac('sha384', $dataJson, $this->privateKey, true)); echo '*'; echo strlen($dataJson); echo '*'; echo $this->publicKey; echo '*'; echo $sig; echo '*'; echo $dataJson; $ch = curl_init($this->apiUrl . $action); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST"); curl_setopt($ch, CURLOPT_POSTFIELDS, $dataJson); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Content-Type: application/json', 'Content-Length: ' . strlen($dataJson), 'X-ICObench-Key: ' . $this->publicKey, 'X-ICObench-Sig: ' . $sig) ); $reply = curl_exec($ch); $ff = $reply; $reply = json_decode($reply,true); if(isset($reply['error'])){ $this->result = $reply['error']; return false; }else if(isset($reply['message'])){ $this->result = $reply['message']; return true; }else if(isset($reply)){ $this->result = json_encode($reply); return true; }else{ $this->result = htmlspecialchars($ff); return false; } } public function result(){ return $this->result; } } $api = new ICObenchAPI(); $api->getICOs("all"); echo $api->result;
Output for git.master, git.master_jit, rfc.property-hooks
o6wlgFpzWLKnLgBuG69YPrLRTSYjkRLSehBksPV0MFwCBG0flSvGAajHOgCMpuD3*2*570d742e-21c0-4a8b-9f13-fbc30f00b804*o6wlgFpzWLKnLgBuG69YPrLRTSYjkRLSehBksPV0MFwCBG0flSvGAajHOgCMpuD3*"" Fatal error: Uncaught Error: Call to undefined function curl_init() in /in/ou9m5:34 Stack trace: #0 /in/ou9m5(12): ICObenchAPI->send('icos/all', '') #1 /in/ou9m5(70): ICObenchAPI->getICOs('all') #2 {main} thrown in /in/ou9m5 on line 34
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

27.4 ms | 402 KiB | 8 Q