3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?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 5.4.15 - 5.6.28, 7.0.0 - 7.1.0
Hello World2 Warning: stream_socket_client(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/TOgWd on line 21 Warning: stream_socket_client(): unable to connect to ssl://gateway.sandbox.push.apple.com:2195 (php_network_getaddresses: getaddrinfo failed: Name or service not known) in /in/TOgWd on line 21 Failed to connect 0 php_network_getaddresses: getaddrinfo failed: Name or service not known
Output for hhvm-3.10.0 - 3.12.0
Hello World2Failed to connect 0 Name or service not known
Output for 5.4.14
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 21 Failed to connect 32641 Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?
Output for 5.4.13
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 21 Failed to connect 32674 Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?
Output for 5.4.12
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 21 Failed to connect 32718 Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?
Output for 5.4.11
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 21 Failed to connect 32619 Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?
Output for 5.4.10
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 21 Failed to connect 32750 Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?
Output for 5.4.9
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 21 Failed to connect 32543 Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?
Output for 5.4.8
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 21 Failed to connect 32708 Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?
Output for 5.4.7
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 21 Failed to connect 32731 Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?
Output for 5.4.6
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 21 Failed to connect 32684 Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?
Output for 5.4.5
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 21 Failed to connect 32647 Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?
Output for 5.4.4
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 21 Failed to connect 32711 Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?
Output for 5.4.3
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 21 Failed to connect 32530 Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?
Output for 5.4.2
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 21 Failed to connect 32527 Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?
Output for 5.4.1
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 21 Failed to connect 32757 Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?
Output for 5.4.0
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 21 Failed to connect 32739 Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?
Output for 5.3.29
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 21 Failed to connect 53426 Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?
Output for 5.0.4 - 5.1.6, 5.2.1, 5.2.4 - 5.2.5, 5.3.10 - 5.3.28
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 21 Failed to connect 0 Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?
Output for 5.3.9
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 21 Failed to connect 32613 Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?
Output for 5.3.8
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 21 Failed to connect 32667 Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?
Output for 5.3.7
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 21 Failed to connect 32738 Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?
Output for 5.3.6
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 21 Failed to connect 32537 Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?
Output for 5.3.5
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 21 Failed to connect 32752 Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?
Output for 5.3.4
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 21 Failed to connect 32730 Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?
Output for 5.3.3
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 21 Failed to connect 32671 Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?
Output for 5.3.2
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 21 Failed to connect 32673 Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?
Output for 5.3.1
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 21 Failed to connect 32584 Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?
Output for 5.3.0
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 21 Failed to connect 32721 Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?
Output for 5.2.11, 5.2.17
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 21 Failed to connect 32764 Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?
Output for 5.2.7, 5.2.9 - 5.2.10, 5.2.16
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 21 Failed to connect 32765 Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?
Output for 5.2.0, 5.2.6, 5.2.8, 5.2.13, 5.2.15
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 21 Failed to connect 32767 Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?
Output for 5.2.12, 5.2.14
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 21 Failed to connect 32766 Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?
Output for 5.2.3
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 21 Failed to connect 32525 Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?
Output for 5.2.2
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 21 Failed to connect 32749 Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?
Output for 5.0.3
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 21 Failed to connect 32529 Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?
Output for 5.0.2
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 21 Failed to connect 32661 Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?
Output for 5.0.1
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 21 Failed to connect 32614 Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?
Output for 5.0.0
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 21 Failed to connect 32531 Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?
Output for 4.4.5 - 4.4.9
Hello World2 Fatal error: Call to undefined function: stream_socket_client() in /in/TOgWd on line 20
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Hello World2 Fatal error: Call to undefined function: stream_socket_client() in /in/TOgWd on line 20
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Hello World2 Fatal error: Call to undefined function: stream_socket_client() in /in/TOgWd on line 20