3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { protected $db; protected $host; protected $user = 'foo'; public function __construct($database, $host = 'localhost') { $this->host = $host; $this->connect(); } public function connect() { echo "connected to ".$this->db." and ".$this->host."\n"; } } class B extends A { function example() { echo "Called example()\n"; } } $b = new B; $b->example(); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sI6RN
function name:  (null)
number of ops:  6
compiled vars:  !0 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   NEW                                              $1      'B'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   25     3        INIT_METHOD_CALL                                         !0, 'example'
          4        DO_FCALL                                      0          
   27     5      > RETURN                                                   1

Class A:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sI6RN
function name:  __construct
number of ops:  7
compiled vars:  !0 = $database, !1 = $host
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      'localhost'
    8     2        ASSIGN_OBJ                                               'host'
          3        OP_DATA                                                  !1
    9     4        INIT_METHOD_CALL                                         'connect'
          5        DO_FCALL                                      0          
   10     6      > 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/sI6RN
function name:  connect
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   FETCH_OBJ_R                                      ~0      'db'
          1        CONCAT                                           ~1      'connected+to+', ~0
          2        CONCAT                                           ~2      ~1, '+and+'
          3        FETCH_OBJ_R                                      ~3      'host'
          4        CONCAT                                           ~4      ~2, ~3
          5        CONCAT                                           ~5      ~4, '%0A'
          6        ECHO                                                     ~5
   14     7      > RETURN                                                   null

End of function connect

End of class A.

Class B:
Function example:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sI6RN
function name:  example
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   ECHO                                                     'Called+example%28%29%0A'
   20     1      > RETURN                                                   null

End of function example

Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sI6RN
function name:  __construct
number of ops:  7
compiled vars:  !0 = $database, !1 = $host
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      'localhost'
    8     2        ASSIGN_OBJ                                               'host'
          3        OP_DATA                                                  !1
    9     4        INIT_METHOD_CALL                                         'connect'
          5        DO_FCALL                                      0          
   10     6      > 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/sI6RN
function name:  connect
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   FETCH_OBJ_R                                      ~0      'db'
          1        CONCAT                                           ~1      'connected+to+', ~0
          2        CONCAT                                           ~2      ~1, '+and+'
          3        FETCH_OBJ_R                                      ~3      'host'
          4        CONCAT                                           ~4      ~2, ~3
          5        CONCAT                                           ~5      ~4, '%0A'
          6        ECHO                                                     ~5
   14     7      > RETURN                                                   null

End of function connect

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.72 ms | 1399 KiB | 13 Q