3v4l.org

run code in 300+ PHP versions simultaneously
<?php class RolesController extends Controller { const RESOURCE_NAME = 'roles'; const MODEL = App\Models\Role::class; } class Controller { private $model; public function __construct() { $modelClass = static::MODEL; $this->model = new $modelClass; } } var_dump(new RolesController);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SYYVp
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   DECLARE_CLASS                                            'rolescontroller', 'controller'
   23     1        INIT_FCALL                                               'var_dump'
          2        NEW                                              $0      'RolesController'
          3        DO_FCALL                                      0          
          4        SEND_VAR                                                 $0
          5        DO_ICALL                                                 
          6      > RETURN                                                   1

Class RolesController: [no user functions]
Class Controller:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SYYVp
function name:  __construct
number of ops:  8
compiled vars:  !0 = $modelClass
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   FETCH_CLASS_CONSTANT                             ~1      'MODEL'
          1        ASSIGN                                                   !0, ~1
   19     2        FETCH_CLASS                                   0  $4      !0
          3        NEW                                              $5      $4
          4        DO_FCALL                                      0          
          5        ASSIGN_OBJ                                               'model'
          6        OP_DATA                                                  $5
   20     7      > RETURN                                                   null

End of function __construct

End of class Controller.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
202.16 ms | 1395 KiB | 15 Q