3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo 'Hello World2'; $deviceToken = 'ec2e840c 2b4ceeeb db4832dd 6b460cc2 736f8a19 9e3de47c 7b685b15 d2c15bb4'; $message = stripslashes('Hello World'); $payload = '{ "aps" : { "alert" : "'.$message.'", "badge" : 1, "sound" : "bingbong.aiff" } }'; $ctx = stream_context_create(); stream_context_set_option($ctx, 'ssl', 'local_cert', 'ck.pem'); stream_context_set_option($ctx, 'ssl', 'passphrase', 'secret'); $fp = stream_socket_client('ssl://gateway.sandbox.push.apple.com:2195', $err, $errstr, 60, STREAM_CLIENT_CONNECT, $ctx); if (!$fp) { print "Failed to connect $err $errstr"; return; } else { print "Notification sent!"; } $msg = chr(0) . pack("n",32) . pack('H*', str_replace(' ', '', $deviceToken)) . pack("n", strlen($payload)) . $payload; print "sending message :" . $payload . "n"; fwrite($fp, $msg); fclose($fp); ?>
Output for git.master, git.master_jit, rfc.property-hooks
Hello World2 Warning: stream_socket_client(): Unable to connect to ssl://gateway.sandbox.push.apple.com:2195 (Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?) in /in/TOgWd on line 20 Failed to connect 0 Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?

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:
29.44 ms | 402 KiB | 8 Q