3v4l.org

run code in 300+ PHP versions simultaneously
<?php class BaseController { } class UserController extends BaseController { public static $get; public function get($id) { echo "Get: $id"; } public static function init() { $r = new ReflectionClass(static::class); $methods = $r->getMethods(ReflectionMethod::IS_PUBLIC); foreach ($methods as $method) { $prop = $method->name; static::$prop = 'foo'; } } } UserController::init(); echo UserController::$get;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HkId7
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   INIT_STATIC_METHOD_CALL                                  'UserController', 'init'
          1        DO_FCALL                                      0          
   26     2        FETCH_STATIC_PROP_R          unknown             ~1      'get'
          3        ECHO                                                     ~1
          4      > RETURN                                                   1

Class BaseController: [no user functions]
Class UserController:
Function get:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HkId7
function name:  get
number of ops:  5
compiled vars:  !0 = $id
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
   11     1        NOP                                                      
          2        FAST_CONCAT                                      ~1      'Get%3A+', !0
          3        ECHO                                                     ~1
   12     4      > RETURN                                                   null

End of function get

Function init:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 10, Position 2 = 16
Branch analysis from position: 10
2 jumps found. (Code = 78) Position 1 = 11, Position 2 = 16
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
filename:       /in/HkId7
function name:  init
number of ops:  18
compiled vars:  !0 = $r, !1 = $methods, !2 = $method, !3 = $prop
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   NEW                                              $4      'ReflectionClass'
          1        FETCH_CLASS_NAME                                 ~5      
          2        SEND_VAL_EX                                              ~5
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $4
   16     5        INIT_METHOD_CALL                                         !0, 'getMethods'
          6        SEND_VAL_EX                                              1
          7        DO_FCALL                                      0  $8      
          8        ASSIGN                                                   !1, $8
   17     9      > FE_RESET_R                                       $10     !1, ->16
         10    > > FE_FETCH_R                                               $10, !2, ->16
   18    11    >   FETCH_OBJ_R                                      ~11     !2, 'name'
         12        ASSIGN                                                   !3, ~11
   19    13        ASSIGN_STATIC_PROP                                       'prop'
         14        OP_DATA                                                  'foo'
   17    15      > JMP                                                      ->10
         16    >   FE_FREE                                                  $10
   21    17      > RETURN                                                   null

End of function init

End of class UserController.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.27 ms | 1395 KiB | 13 Q