3v4l.org

run code in 300+ PHP versions simultaneously
<?php class foo { public static function getInstance() { return new self(); } } class bar extends foo { } $obj = bar::getInstance(); var_dump($obj);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mtEdT
function name:  (null)
number of ops:  7
compiled vars:  !0 = $obj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   INIT_STATIC_METHOD_CALL                                  'bar', 'getInstance'
          1        DO_FCALL                                      0  $1      
          2        ASSIGN                                                   !0, $1
   13     3        INIT_FCALL                                               'var_dump'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                                 
          6      > RETURN                                                   1

Class foo:
Function getinstance:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mtEdT
function name:  getInstance
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   NEW                          self                $0      
          1        DO_FCALL                                      0          
          2      > RETURN                                                   $0
    5     3*     > RETURN                                                   null

End of function getinstance

End of class foo.

Class bar:
Function getinstance:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mtEdT
function name:  getInstance
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   NEW                          self                $0      
          1        DO_FCALL                                      0          
          2      > RETURN                                                   $0
    5     3*     > RETURN                                                   null

End of function getinstance

End of class bar.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.61 ms | 1395 KiB | 15 Q