3v4l.org

run code in 300+ PHP versions simultaneously
<?php $model = new Model; echo $model . "\n"; $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/YFF22
function name:  (null)
number of ops:  12
compiled vars:  !0 = $model, !1 = $try
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   NEW                                              $2      'Model'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
    3     3        CONCAT                                           ~5      !0, '%0A'
          4        ECHO                                                     ~5
    4     5        NEW                                              $6      'Instance'
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !1, $6
    5     8        ECHO                                                     !1
    7     9        DECLARE_CLASS                                            'model'
   30    10        DECLARE_CLASS                                            'instance', 'model'
   36    11      > RETURN                                                   1

Class Model:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YFF22
function name:  __construct
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   INIT_METHOD_CALL                                         'init'
          1        DO_FCALL                                      0          
   11     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/YFF22
function name:  init
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   INIT_METHOD_CALL                                         'className'
          1        DO_FCALL                                      0  $0      
          2      > RETURN                                                   $0
   16     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/YFF22
function name:  __toString
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   INIT_METHOD_CALL                                         'className'
          1        DO_FCALL                                      0  $0      
          2        VERIFY_RETURN_TYPE                                       $0
          3      > RETURN                                                   $0
   21     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/YFF22
function name:  className
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   GET_CALLED_CLASS                                 ~0      
          1      > RETURN                                                   ~0
   26     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/YFF22
function name:  init
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   34     0  E >   ECHO                                                     'tada%21+'
   35     1      > RETURN                                                   null

End of function init

End of class Instance.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.55 ms | 1403 KiB | 13 Q