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); ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 35, Position 2 = 42
Branch analysis from position: 35
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 42
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TOgWd
function name:  (null)
number of ops:  77
compiled vars:  !0 = $deviceToken, !1 = $message, !2 = $payload, !3 = $ctx, !4 = $fp, !5 = $err, !6 = $errstr, !7 = $msg
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ECHO                                                     'Hello+World2'
    5     1        ASSIGN                                                   !0, 'ec2e840c+2b4ceeeb+db4832dd+6b460cc2+736f8a19+9e3de47c+7b685b15+d2c15bb4'
    6     2        INIT_FCALL                                               'stripslashes'
          3        SEND_VAL                                                 'Hello+World'
          4        DO_ICALL                                         $9      
          5        ASSIGN                                                   !1, $9
   11     6        CONCAT                                           ~11     '%7B%0A%09%09%22aps%22+%3A%0A%09%09%09%7B%0A%09%09%09%09%22alert%22+%3A+%22', !1
          7        CONCAT                                           ~12     ~11, '%22%2C%0A%09%09%09%09%22badge%22+%3A+1%2C%0A%09%09%09%09%22sound%22+%3A+%22bingbong.aiff%22%0A%09%09%09%7D%0A%09%7D'
    8     8        ASSIGN                                                   !2, ~12
   17     9        INIT_FCALL                                               'stream_context_create'
         10        DO_ICALL                                         $14     
         11        ASSIGN                                                   !3, $14
   18    12        INIT_FCALL                                               'stream_context_set_option'
         13        SEND_VAR                                                 !3
         14        SEND_VAL                                                 'ssl'
         15        SEND_VAL                                                 'local_cert'
         16        SEND_VAL                                                 'ck.pem'
         17        DO_ICALL                                                 
   19    18        INIT_FCALL                                               'stream_context_set_option'
         19        SEND_VAR                                                 !3
         20        SEND_VAL                                                 'ssl'
         21        SEND_VAL                                                 'passphrase'
         22        SEND_VAL                                                 'secret'
         23        DO_ICALL                                                 
   20    24        INIT_FCALL                                               'stream_socket_client'
         25        SEND_VAL                                                 'ssl%3A%2F%2Fgateway.sandbox.push.apple.com%3A2195'
         26        SEND_REF                                                 !5
         27        SEND_REF                                                 !6
         28        SEND_VAL                                                 60
   21    29        SEND_VAL                                                 4
         30        SEND_VAR                                                 !3
         31        DO_ICALL                                         $18     
   20    32        ASSIGN                                                   !4, $18
   22    33        BOOL_NOT                                         ~20     !4
         34      > JMPZ                                                     ~20, ->42
   23    35    >   ROPE_INIT                                     4  ~22     'Failed+to+connect+'
         36        ROPE_ADD                                      1  ~22     ~22, !5
         37        ROPE_ADD                                      2  ~22     ~22, '+'
         38        ROPE_END                                      3  ~21     ~22, !6
         39        ECHO                                                     ~21
   24    40      > RETURN                                                   null
         41*       JMP                                                      ->43
   26    42    >   ECHO                                                     'Notification+sent%21'
   29    43        INIT_FCALL                                               'pack'
         44        SEND_VAL                                                 'n'
         45        SEND_VAL                                                 32
         46        DO_ICALL                                         $24     
         47        CONCAT                                           ~25     '%00', $24
         48        INIT_FCALL                                               'pack'
         49        SEND_VAL                                                 'H%2A'
         50        INIT_FCALL                                               'str_replace'
         51        SEND_VAL                                                 '+'
         52        SEND_VAL                                                 ''
         53        SEND_VAR                                                 !0
         54        DO_ICALL                                         $26     
         55        SEND_VAR                                                 $26
         56        DO_ICALL                                         $27     
         57        CONCAT                                           ~28     ~25, $27
         58        INIT_FCALL                                               'pack'
         59        SEND_VAL                                                 'n'
         60        STRLEN                                           ~29     !2
         61        SEND_VAL                                                 ~29
         62        DO_ICALL                                         $30     
         63        CONCAT                                           ~31     ~28, $30
         64        CONCAT                                           ~32     ~31, !2
         65        ASSIGN                                                   !7, ~32
   30    66        CONCAT                                           ~34     'sending+message+%3A', !2
         67        CONCAT                                           ~35     ~34, 'n'
         68        ECHO                                                     ~35
   31    69        INIT_FCALL                                               'fwrite'
         70        SEND_VAR                                                 !4
         71        SEND_VAR                                                 !7
         72        DO_ICALL                                                 
   33    73        INIT_FCALL                                               'fclose'
         74        SEND_VAR                                                 !4
         75        DO_ICALL                                                 
   35    76      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
179.85 ms | 1400 KiB | 29 Q