3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Replace with the real server API key from Google APIs $apiKey = "AIzaSyDaRbV6xDrsAiEMzvK7cMu96-YbdvxBN98"; // Replace with the real client registration IDs $registrationIDs = array( "APA91bFEgFIFHLRFTI7aQUNuQWvuTKGBnx8M930v5aCpbSzBbU3VyDFYKaBBV7kfaVPAkfuHOES1ftmdLHCLcBWbi8u6-YuP2D_qGsSeH0JBZnb5p0n6OJ8","APA91bFEgFIFHLRFTI7aQUNuQWvuTKGBnx8M930v5aCpbSzBbU3VyDFYKaBBV7kfaVPAkfuHOES1ftmdLHCLcBWbi8u6-YuP2D_qGsSeH0JBZnb5p0n6OJ8"); // Message to be sent $message = "Hoi RayRay"; // Set POST variables $url = 'https://android.googleapis.com/gcm/send'; $fields = array( 'registration_ids' => $registrationIDs, 'data' => array( "message" => $message), ); $headers = array( 'Authorization: key=' . $apiKey, 'Content-Type: application/json' ); // Open connection $ch = curl_init(); // Set the URL, number of POST vars, POST data curl_setopt( $ch, CURLOPT_URL, $url); curl_setopt( $ch, CURLOPT_POST, true); curl_setopt( $ch, CURLOPT_HTTPHEADER, $headers); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true); //curl_setopt( $ch, CURLOPT_POSTFIELDS, json_encode( $fields)); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // curl_setopt($ch, CURLOPT_POST, true); // curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode( $fields)); // Execute post $result = curl_exec($ch); // Close connection curl_close($ch); echo $result; //print_r($result); //var_dump($result); ?>
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught Error: Call to undefined function curl_init() in /in/qkTPF:24 Stack trace: #0 {main} thrown in /in/qkTPF on line 24
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:
58.63 ms | 401 KiB | 8 Q