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); $props = array_keys($r->getStaticProperties()); foreach ($methods as $method) { $prop = $method->name; if (in_array($prop, $props)) { static::$$prop = static::class . '@' . $method; } } } } UserController::init(); echo UserController::$get;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UD6fc
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   28     0  E >   INIT_STATIC_METHOD_CALL                                  'UserController', 'init'
          1        DO_FCALL                                      0          
   29     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/UD6fc
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 = 16, Position 2 = 30
Branch analysis from position: 16
2 jumps found. (Code = 78) Position 1 = 17, Position 2 = 30
Branch analysis from position: 17
2 jumps found. (Code = 43) Position 1 = 24, Position 2 = 29
Branch analysis from position: 24
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
Branch analysis from position: 29
Branch analysis from position: 30
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 30
filename:       /in/UD6fc
function name:  init
number of ops:  32
compiled vars:  !0 = $r, !1 = $methods, !2 = $props, !3 = $method, !4 = $prop
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   NEW                                              $5      'ReflectionClass'
          1        FETCH_CLASS_NAME                                 ~6      
          2        SEND_VAL_EX                                              ~6
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $5
   16     5        INIT_METHOD_CALL                                         !0, 'getMethods'
          6        SEND_VAL_EX                                              1
          7        DO_FCALL                                      0  $9      
          8        ASSIGN                                                   !1, $9
   17     9        INIT_FCALL                                               'array_keys'
         10        INIT_METHOD_CALL                                         !0, 'getStaticProperties'
         11        DO_FCALL                                      0  $11     
         12        SEND_VAR                                                 $11
         13        DO_ICALL                                         $12     
         14        ASSIGN                                                   !2, $12
   18    15      > FE_RESET_R                                       $14     !1, ->30
         16    > > FE_FETCH_R                                               $14, !3, ->30
   19    17    >   FETCH_OBJ_R                                      ~15     !3, 'name'
         18        ASSIGN                                                   !4, ~15
   20    19        INIT_FCALL                                               'in_array'
         20        SEND_VAR                                                 !4
         21        SEND_VAR                                                 !2
         22        DO_ICALL                                         $17     
         23      > JMPZ                                                     $17, ->29
   21    24    >   FETCH_CLASS_NAME                                 ~19     
         25        CONCAT                                           ~20     ~19, '%40'
         26        CONCAT                                           ~21     ~20, !3
         27        ASSIGN_STATIC_PROP                                       !4
         28        OP_DATA                                                  ~21
   18    29    > > JMP                                                      ->16
         30    >   FE_FREE                                                  $14
   24    31      > RETURN                                                   null

End of function init

End of class UserController.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.61 ms | 1400 KiB | 17 Q