3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Connection { protected $link; private $server, $username, $password, $db; public function __construct($server, $username, $password, $db) { echo 'constructing'; $this->server = $server; $this->username = $username; $this->password = $password; $this->db = $db; $this->connect(); } private function connect() { echo 'conected'; } public function __sleep() { return array('server', 'username', 'password', 'db'); } public function __wakeup() { $this->connect(); } } $a = new Connection('s', 'u', 'p', 'd'); echo '-----------------------'; $sa = serialize($a); echo 'n------------------------'; $usa = unserialize($sa);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0GRnk
function name:  (null)
number of ops:  18
compiled vars:  !0 = $a, !1 = $sa, !2 = $usa
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   35     0  E >   NEW                                              $3      'Connection'
          1        SEND_VAL_EX                                              's'
          2        SEND_VAL_EX                                              'u'
          3        SEND_VAL_EX                                              'p'
          4        SEND_VAL_EX                                              'd'
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !0, $3
   37     7        ECHO                                                     '-----------------------'
   39     8        INIT_FCALL                                               'serialize'
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                         $6      
         11        ASSIGN                                                   !1, $6
   41    12        ECHO                                                     'n------------------------'
   43    13        INIT_FCALL                                               'unserialize'
         14        SEND_VAR                                                 !1
         15        DO_ICALL                                         $8      
         16        ASSIGN                                                   !2, $8
         17      > RETURN                                                   1

Class Connection:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0GRnk
function name:  __construct
number of ops:  16
compiled vars:  !0 = $server, !1 = $username, !2 = $password, !3 = $db
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
          3        RECV                                             !3      
   10     4        ECHO                                                     'constructing'
   11     5        ASSIGN_OBJ                                               'server'
          6        OP_DATA                                                  !0
   12     7        ASSIGN_OBJ                                               'username'
          8        OP_DATA                                                  !1
   13     9        ASSIGN_OBJ                                               'password'
         10        OP_DATA                                                  !2
   14    11        ASSIGN_OBJ                                               'db'
         12        OP_DATA                                                  !3
   15    13        INIT_METHOD_CALL                                         'connect'
         14        DO_FCALL                                      0          
   16    15      > RETURN                                                   null

End of function __construct

Function connect:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0GRnk
function name:  connect
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   ECHO                                                     'conected'
   21     1      > RETURN                                                   null

End of function connect

Function __sleep:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0GRnk
function name:  __sleep
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E > > RETURN                                                   <array>
   26     1*     > RETURN                                                   null

End of function __sleep

Function __wakeup:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0GRnk
function name:  __wakeup
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   30     0  E >   INIT_METHOD_CALL                                         'connect'
          1        DO_FCALL                                      0          
   31     2      > RETURN                                                   null

End of function __wakeup

End of class Connection.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.73 ms | 1392 KiB | 17 Q