3v4l.org

run code in 300+ PHP versions simultaneously
<?php print_r($_POST); require_once "tcp_ping.class.php"; $pinger = new TcpPingWrapper(); $strAccept = isset($_SERVER['HTTP_ACCEPT']) ? $_SERVER['HTTP_ACCEPT'] : ''; $strUA = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : ''; if (strpos($strAccept, "application/xhtml+xml") !== false || stristr($strUA, "validator") !== false) { $content_type = 'application/xhtml+xml'; } else { $content_type = 'text/html'; } header("Content-Type: " . $content_type . "; charset=utf-8;"); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <title>TCP Ping Example</title> <meta http-equiv="Content-Type" content="<?php echo $content_type?>; charset=utf-8;" /> <meta name="description" content="TCP Ping example by Andronicus Riyono" /> <meta name="keywords" content="andronicus, riyono, tcp ping, ping, tcp, php, sockets, socket" /> <style type="text/css"> body { font-family: "Trebuchet MS", Tahoma, Arial, Helvetica, sans-serif; } a img { border:0; } table, tr, th, td { border: 1px solid #039; border-collapse: collapse; } th, td { padding: .5em; } </style> </head> <body> <?php if (isset($_POST['multiple'])) { $_REQUEST['hosts'] = preg_split("/\s+/", $_POST['multiple'], 10, PREG_SPLIT_NO_EMPTY); } ?> <h1>Connectivity Ping</h1> <p>Enter up to 10 hostname or IP address you would like to ping on the textarea. One host or IP address per line. Hit the ping button to execute the TCP Connectivity Ping.</p> <p>The TCP Connectivity Ping will try to determine whether a host is alive or dead by sending NOOP Command to Common TCP Service (http, ftp, telnet, mail, in that order).</p> <form action="<?php echo $_SERVER['PHP_SELF']?>" method="post"> <div><textarea id="multiple" name="multiple" rows="10" cols="40"><?php if (isset($_POST['multiple'])) { echo $_POST['multiple']; } ?></textarea></div> <div><input id="submit" name="submit" type="submit" value="Ping" /></div> </form> <?php if (isset($_REQUEST['hosts'])) { $pinger->ReadFormInput(); $pinger->Ping(); ?> <h2>Connectivity Ping Result</h2> <h3>Text only (&lt;pre&gt; is used here)</h3> <pre> <?php $pinger->DisplayOutputAsText(); ?> </pre> <h3>Ordinary HTML</h3> <?php $pinger->DisplayOutputAsHtml(); ?> <h3>Ordinary HTML table</h3> <?php $pinger->DisplayOutputAsHtmlTable(); ?> <h3>Fancy HTML table</h3> <?php $pinger->DisplayOutputAsHtmlFancy(); ?> <?php } ?> <p> <a href="http://validator.w3.org/check?uri=referer"><img src="http://riyono.com/images/valid-xhtml10.png" alt="Valid XHTML 1.0!" height="15" width="80" /></a> </p> <address>Copyright (c) 2005 Andronicus Riyono &lt;nick@riyono.com&gt;</address> </body> </html>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 15
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
2 jumps found. (Code = 43) Position 1 = 20, Position 2 = 24
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 25
Branch analysis from position: 25
2 jumps found. (Code = 47) Position 1 = 32, Position 2 = 38
Branch analysis from position: 32
2 jumps found. (Code = 43) Position 1 = 39, Position 2 = 41
Branch analysis from position: 39
1 jumps found. (Code = 42) Position 1 = 42
Branch analysis from position: 42
2 jumps found. (Code = 43) Position 1 = 53, Position 2 = 64
Branch analysis from position: 53
2 jumps found. (Code = 43) Position 1 = 72, Position 2 = 75
Branch analysis from position: 72
2 jumps found. (Code = 43) Position 1 = 79, Position 2 = 96
Branch analysis from position: 79
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 96
Branch analysis from position: 75
Branch analysis from position: 64
Branch analysis from position: 41
2 jumps found. (Code = 43) Position 1 = 53, Position 2 = 64
Branch analysis from position: 53
Branch analysis from position: 64
Branch analysis from position: 38
Branch analysis from position: 24
2 jumps found. (Code = 47) Position 1 = 32, Position 2 = 38
Branch analysis from position: 32
Branch analysis from position: 38
Branch analysis from position: 15
2 jumps found. (Code = 43) Position 1 = 20, Position 2 = 24
Branch analysis from position: 20
Branch analysis from position: 24
filename:       /in/UtHMj
function name:  (null)
number of ops:  98
compiled vars:  !0 = $pinger, !1 = $strAccept, !2 = $strUA, !3 = $content_type
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'print_r'
          1        FETCH_R                      global              ~4      '_POST'
          2        SEND_VAL                                                 ~4
          3        DO_ICALL                                                 
    3     4        INCLUDE_OR_EVAL                                          'tcp_ping.class.php', REQUIRE_ONCE
    4     5        NEW                                              $7      'TcpPingWrapper'
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !0, $7
    6     8        FETCH_IS                                         ~10     '_SERVER'
          9        ISSET_ISEMPTY_DIM_OBJ                         0          ~10, 'HTTP_ACCEPT'
         10      > JMPZ                                                     ~11, ->15
         11    >   FETCH_R                      global              ~12     '_SERVER'
         12        FETCH_DIM_R                                      ~13     ~12, 'HTTP_ACCEPT'
         13        QM_ASSIGN                                        ~14     ~13
         14      > JMP                                                      ->16
         15    >   QM_ASSIGN                                        ~14     ''
         16    >   ASSIGN                                                   !1, ~14
    7    17        FETCH_IS                                         ~16     '_SERVER'
         18        ISSET_ISEMPTY_DIM_OBJ                         0          ~16, 'HTTP_USER_AGENT'
         19      > JMPZ                                                     ~17, ->24
         20    >   FETCH_R                      global              ~18     '_SERVER'
         21        FETCH_DIM_R                                      ~19     ~18, 'HTTP_USER_AGENT'
         22        QM_ASSIGN                                        ~20     ~19
         23      > JMP                                                      ->25
         24    >   QM_ASSIGN                                        ~20     ''
         25    >   ASSIGN                                                   !2, ~20
    8    26        INIT_FCALL                                               'strpos'
         27        SEND_VAR                                                 !1
         28        SEND_VAL                                                 'application%2Fxhtml%2Bxml'
         29        DO_ICALL                                         $22     
         30        TYPE_CHECK                                  1018  ~23     $22
         31      > JMPNZ_EX                                         ~23     ~23, ->38
         32    >   INIT_FCALL                                               'stristr'
         33        SEND_VAR                                                 !2
         34        SEND_VAL                                                 'validator'
         35        DO_ICALL                                         $24     
         36        TYPE_CHECK                                  1018  ~25     $24
         37        BOOL                                             ~23     ~25
         38    > > JMPZ                                                     ~23, ->41
   10    39    >   ASSIGN                                                   !3, 'application%2Fxhtml%2Bxml'
         40      > JMP                                                      ->42
   14    41    >   ASSIGN                                                   !3, 'text%2Fhtml'
   16    42    >   INIT_FCALL                                               'header'
         43        CONCAT                                           ~28     'Content-Type%3A+', !3
         44        CONCAT                                           ~29     ~28, '%3B+charset%3Dutf-8%3B'
         45        SEND_VAL                                                 ~29
         46        DO_ICALL                                                 
   18    47        ECHO                                                     '%3C%21DOCTYPE+html+PUBLIC+%22-%2F%2FW3C%2F%2FDTD+XHTML+1.0+Strict%2F%2FEN%22%0A++++++%22http%3A%2F%2Fwww.w3.org%2FTR%2Fxhtml1%2FDTD%2Fxhtml1-strict.dtd%22%3E%0A%0A%3Chtml+xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%22%0A++++++xml%3Alang%3D%22en%22%3E%0A%0A++%3Chead%3E%0A++++%3Ctitle%3ETCP+Ping+Example%3C%2Ftitle%3E%0A++++%3Cmeta+http-equiv%3D%22Content-Type%22+content%3D%22'
   26    48        ECHO                                                     !3
         49        ECHO                                                     '%3B+charset%3Dutf-8%3B%22+%2F%3E%0A++++%3Cmeta+name%3D%22description%22+content%3D%22TCP+Ping+example+by+Andronicus+Riyono%22+%2F%3E%0A++++%3Cmeta+name%3D%22keywords%22+content%3D%22andronicus%2C+riyono%2C+tcp+ping%2C+ping%2C+tcp%2C+php%2C+sockets%2C+socket%22+%2F%3E%0A++++%3Cstyle+type%3D%22text%2Fcss%22%3E%0A+++++++body+%7B%0A+++++++++++font-family%3A+%22Trebuchet+MS%22%2C+Tahoma%2C+Arial%2C+Helvetica%2C+sans-serif%3B++++%0A+++++++%7D%0A+++++++a+img+%7B%0A+++++++++++border%3A0%3B++++%0A+++++++%7D%0A+++++++table%2C+tr%2C+th%2C+td+%7B%0A+++++++++++border%3A+1px+solid+%23039%3B%0A+++++++++++border-collapse%3A+collapse%3B%0A+++++++%7D%0A+++++++th%2C+td+%7B%0A+++++++++++padding%3A+.5em%3B%0A+++++++%7D%0A++++%3C%2Fstyle%3E%0A++%3C%2Fhead%3E%0A++%3Cbody%3E+%0A'
   47    50        FETCH_IS                                         ~31     '_POST'
         51        ISSET_ISEMPTY_DIM_OBJ                         0          ~31, 'multiple'
         52      > JMPZ                                                     ~32, ->64
   48    53    >   INIT_FCALL                                               'preg_split'
         54        SEND_VAL                                                 '%2F%5Cs%2B%2F'
         55        FETCH_R                      global              ~35     '_POST'
         56        FETCH_DIM_R                                      ~36     ~35, 'multiple'
         57        SEND_VAL                                                 ~36
         58        SEND_VAL                                                 10
         59        SEND_VAL                                                 1
         60        DO_ICALL                                         $37     
         61        FETCH_W                      global              $33     '_REQUEST'
         62        ASSIGN_DIM                                               $33, 'hosts'
         63        OP_DATA                                                  $37
   51    64    >   ECHO                                                     '%3Ch1%3EConnectivity+Ping%3C%2Fh1%3E%0A++%3Cp%3EEnter+up+to+10+hostname+or+IP+address+you+would+like+to+ping+on+the+textarea.+One+host+or+IP+address+per+line.+Hit+the+ping+button+to+execute+the+TCP+Connectivity+Ping.%3C%2Fp%3E%0A++%3Cp%3EThe+TCP+Connectivity+Ping+will+try+to+determine+whether+a+host+is+alive+or+dead+by+sending+NOOP+Command+to+Common+TCP+Service+%28http%2C+ftp%2C+telnet%2C+mail%2C+in+that+order%29.%3C%2Fp%3E%0A++%3Cform+action%3D%22'
   54    65        FETCH_R                      global              ~38     '_SERVER'
         66        FETCH_DIM_R                                      ~39     ~38, 'PHP_SELF'
         67        ECHO                                                     ~39
         68        ECHO                                                     '%22+method%3D%22post%22%3E%0A+++++%3Cdiv%3E%3Ctextarea+id%3D%22multiple%22+name%3D%22multiple%22+rows%3D%2210%22+cols%3D%2240%22%3E'
   56    69        FETCH_IS                                         ~40     '_POST'
         70        ISSET_ISEMPTY_DIM_OBJ                         0          ~40, 'multiple'
         71      > JMPZ                                                     ~41, ->75
   57    72    >   FETCH_R                      global              ~42     '_POST'
         73        FETCH_DIM_R                                      ~43     ~42, 'multiple'
         74        ECHO                                                     ~43
   59    75    >   ECHO                                                     '%3C%2Ftextarea%3E%3C%2Fdiv%3E%0A+++++%3Cdiv%3E%3Cinput+id%3D%22submit%22+name%3D%22submit%22+type%3D%22submit%22+value%3D%22Ping%22+%2F%3E%3C%2Fdiv%3E%0A++%3C%2Fform%3E%0A'
   63    76        FETCH_IS                                         ~44     '_REQUEST'
         77        ISSET_ISEMPTY_DIM_OBJ                         0          ~44, 'hosts'
         78      > JMPZ                                                     ~45, ->96
   65    79    >   INIT_METHOD_CALL                                         !0, 'ReadFormInput'
         80        DO_FCALL                                      0          
   66    81        INIT_METHOD_CALL                                         !0, 'Ping'
         82        DO_FCALL                                      0          
   68    83        ECHO                                                     '%3Ch2%3EConnectivity+Ping+Result%3C%2Fh2%3E%0A%3Ch3%3EText+only+%28%26lt%3Bpre%26gt%3B+is+used+here%29%3C%2Fh3%3E%0A%3Cpre%3E%0A'
   72    84        INIT_METHOD_CALL                                         !0, 'DisplayOutputAsText'
         85        DO_FCALL                                      0          
   74    86        ECHO                                                     '%3C%2Fpre%3E%0A%0A%0A%3Ch3%3EOrdinary+HTML%3C%2Fh3%3E%0A'
   79    87        INIT_METHOD_CALL                                         !0, 'DisplayOutputAsHtml'
         88        DO_FCALL                                      0          
   81    89        ECHO                                                     '%0A%3Ch3%3EOrdinary+HTML+table%3C%2Fh3%3E%0A'
   84    90        INIT_METHOD_CALL                                         !0, 'DisplayOutputAsHtmlTable'
         91        DO_FCALL                                      0          
   86    92        ECHO                                                     '%0A%3Ch3%3EFancy+HTML+table%3C%2Fh3%3E%0A'
   89    93        INIT_METHOD_CALL                                         !0, 'DisplayOutputAsHtmlFancy'
         94        DO_FCALL                                      0          
   91    95        ECHO                                                     '%0A'
   95    96    >   ECHO                                                     '++++%3Cp%3E%0A++++++%3Ca+href%3D%22http%3A%2F%2Fvalidator.w3.org%2Fcheck%3Furi%3Dreferer%22%3E%3Cimg%0A++++++++++src%3D%22http%3A%2F%2Friyono.com%2Fimages%2Fvalid-xhtml10.png%22%0A++++++++++alt%3D%22Valid+XHTML+1.0%21%22+height%3D%2215%22+width%3D%2280%22+%2F%3E%3C%2Fa%3E%0A++++%3C%2Fp%3E%0A%3Caddress%3ECopyright+%28c%29+2005+Andronicus+Riyono+%26lt%3Bnick%40riyono.com%26gt%3B%3C%2Faddress%3E%0A++%3C%2Fbody%3E%0A%3C%2Fhtml%3E'
  102    97      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.25 ms | 1408 KiB | 23 Q