3v4l.org

run code in 300+ PHP versions simultaneously
<?php $try = new Instance; echo $try; class Model{ public function __construct(){ $this->init(); } public function init() { return $this->className(); } public function __toString() { return $this->className(); } public function className() { return get_called_class(); } } class Instance extends Model { public function init() { echo "tada! "; } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/l4IiY
function name:  (null)
number of ops:  7
compiled vars:  !0 = $try
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   NEW                                              $1      'Instance'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
    3     3        ECHO                                                     !0
    5     4        DECLARE_CLASS                                            'model'
   28     5        DECLARE_CLASS                                            'instance', 'model'
   34     6      > RETURN                                                   1

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

End of function __construct

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

End of function init

Function __tostring:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/l4IiY
function name:  __toString
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   INIT_METHOD_CALL                                         'className'
          1        DO_FCALL                                      0  $0      
          2        VERIFY_RETURN_TYPE                                       $0
          3      > RETURN                                                   $0
   19     4*       VERIFY_RETURN_TYPE                                       
          5*     > RETURN                                                   null

End of function __tostring

Function classname:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/l4IiY
function name:  className
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   GET_CALLED_CLASS                                 ~0      
          1      > RETURN                                                   ~0
   24     2*     > RETURN                                                   null

End of function classname

End of class Model.

Class Instance:
Function init:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/l4IiY
function name:  init
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   32     0  E >   ECHO                                                     'tada%21+'
   33     1      > RETURN                                                   null

End of function init

End of class Instance.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.68 ms | 1399 KiB | 13 Q