3v4l.org

run code in 300+ PHP versions simultaneously
<?php abstract class First{ const id = __CLASS__; public static function start(){ static::run(new static); } protected static function run(First $instance){ echo __CLASS__, PHP_EOL; $instance->dynamicRun(); } protected function dynamicRun(){ echo self::id, PHP_EOL, get_class($this); } } class Second extends First{ const id = __CLASS__; public static function start(){ parent::run(new static); } } Second::start();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UguvA
function name:  (null)
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   INIT_STATIC_METHOD_CALL                                  'Second', 'start'
          1        DO_FCALL                                      0          
          2      > RETURN                                                   1

Class First:
Function start:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UguvA
function name:  start
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   INIT_STATIC_METHOD_CALL                                  'run'
          1        NEW                          static              $0      
          2        DO_FCALL                                      0          
          3        SEND_VAR_NO_REF_EX                                       $0
          4        DO_FCALL                                      0          
    6     5      > RETURN                                                   null

End of function start

Function run:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UguvA
function name:  run
number of ops:  6
compiled vars:  !0 = $instance
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    8     1        ECHO                                                     'First'
          2        ECHO                                                     '%0A'
    9     3        INIT_METHOD_CALL                                         !0, 'dynamicRun'
          4        DO_FCALL                                      0          
   10     5      > RETURN                                                   null

End of function run

Function dynamicrun:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UguvA
function name:  dynamicRun
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   ECHO                                                     'First'
          1        ECHO                                                     '%0A'
          2        FETCH_THIS                                       ~0      
          3        GET_CLASS                                        ~1      ~0
          4        ECHO                                                     ~1
   14     5      > RETURN                                                   null

End of function dynamicrun

End of class First.

Class Second:
Function start:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UguvA
function name:  start
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   INIT_STATIC_METHOD_CALL                                  'run'
          1        NEW                          static              $0      
          2        DO_FCALL                                      0          
          3        SEND_VAR_NO_REF_EX                                       $0
          4        DO_FCALL                                      0          
   21     5      > RETURN                                                   null

End of function start

Function run:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UguvA
function name:  run
number of ops:  6
compiled vars:  !0 = $instance
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    8     1        ECHO                                                     'First'
          2        ECHO                                                     '%0A'
    9     3        INIT_METHOD_CALL                                         !0, 'dynamicRun'
          4        DO_FCALL                                      0          
   10     5      > RETURN                                                   null

End of function run

Function dynamicrun:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UguvA
function name:  dynamicRun
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   ECHO                                                     'First'
          1        ECHO                                                     '%0A'
          2        FETCH_THIS                                       ~0      
          3        GET_CLASS                                        ~1      ~0
          4        ECHO                                                     ~1
   14     5      > RETURN                                                   null

End of function dynamicrun

End of class Second.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.66 ms | 1399 KiB | 13 Q