3v4l.org

run code in 300+ PHP versions simultaneously
<?php //////////////////////////// /** * IRCBot = root directory. * * @file: IRCBot/src/Connect.php */ namespace Connect; class Connect { protected $server; // Planning to use this for the YAML config protected $port; // Planning to use this for the YAML config public function connect($server, $port) { try { fsockopen($server, $port); } catch (Exception $e) { echo "[ERROR] " . $e; } return $this; // I want to chain this function with a function called sendUserData... } } //////////////////////////// /** * IRCBot = root directory. * * @file: IRCBot/src/Start.php */ namespace Connect; class Start { // I want to run all functions on startup public function __construct(Connect $connect) { $connect->connect("roddenberry.freenode.net", 6667); } } //////////////////////////// /** * IRCBot = root directory. * * @file: IRCBot/index.php */ //require_once 'src/Start.php'; //require_once 'src/Connect.php'; use Connect\Connect; use Connect\Start; error_reporting(E_ALL); // @TODO: [ ] Add a utility that get's the native timezone; date_default_timezone_set("UTC"); $connect = new Connect(); var_dump($connect); $start = new Start($connect); var_dump($start);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5PS11
function name:  (null)
number of ops:  21
compiled vars:  !0 = $connect, !1 = $start
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   54     0  E >   INIT_NS_FCALL_BY_NAME                                    'Connect%5Cerror_reporting'
          1        FETCH_CONSTANT                                   ~2      'Connect%5CE_ALL'
          2        SEND_VAL_EX                                              ~2
          3        DO_FCALL                                      0          
   57     4        INIT_NS_FCALL_BY_NAME                                    'Connect%5Cdate_default_timezone_set'
          5        SEND_VAL_EX                                              'UTC'
          6        DO_FCALL                                      0          
   59     7        NEW                                              $5      'Connect%5CConnect'
          8        DO_FCALL                                      0          
          9        ASSIGN                                                   !0, $5
   60    10        INIT_NS_FCALL_BY_NAME                                    'Connect%5Cvar_dump'
         11        SEND_VAR_EX                                              !0
         12        DO_FCALL                                      0          
   62    13        NEW                                              $9      'Connect%5CStart'
         14        SEND_VAR_EX                                              !0
         15        DO_FCALL                                      0          
         16        ASSIGN                                                   !1, $9
   63    17        INIT_NS_FCALL_BY_NAME                                    'Connect%5Cvar_dump'
         18        SEND_VAR_EX                                              !1
         19        DO_FCALL                                      0          
         20      > RETURN                                                   1

Class Connect\Connect:
Function connect:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 7
Branch analysis from position: 7
2 jumps found. (Code = 107) Position 1 = 8, Position 2 = -2
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5PS11
function name:  connect
number of ops:  13
compiled vars:  !0 = $server, !1 = $port, !2 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   18     2        INIT_NS_FCALL_BY_NAME                                    'Connect%5Cfsockopen'
          3        SEND_VAR_EX                                              !0
          4        SEND_VAR_EX                                              !1
          5        DO_FCALL                                      0          
          6      > JMP                                                      ->10
   19     7  E > > CATCH                                       last         'Connect%5CException'
   20     8    >   CONCAT                                           ~4      '%5BERROR%5D+', !2
          9        ECHO                                                     ~4
   22    10    >   FETCH_THIS                                       ~5      
         11      > RETURN                                                   ~5
   23    12*     > RETURN                                                   null

End of function connect

End of class Connect\Connect.

Class Connect\Start:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5PS11
function name:  __construct
number of ops:  6
compiled vars:  !0 = $connect
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   36     0  E >   RECV                                             !0      
   37     1        INIT_METHOD_CALL                                         !0, 'connect'
          2        SEND_VAL_EX                                              'roddenberry.freenode.net'
          3        SEND_VAL_EX                                              6667
          4        DO_FCALL                                      0          
   38     5      > RETURN                                                   null

End of function __construct

End of class Connect\Start.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
174.62 ms | 1400 KiB | 21 Q