3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace App\Models; class User { public static function buildItem(string $param): void { echo $param; } } namespace App\Http\Controllers; class Controller { } class UserController extends AbstractController { protected const className = 'User'; } class AbstractController extends Controller { private const MODEL_NAMESPACE = 'App\\Models'; public function createItem(): void { $className = self::MODEL_NAMESPACE . '\\' . static::className; $className::buildItem('test'); } } $userController = new UserController(); $userController->createItem();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ng6bl
function name:  (null)
number of ops:  7
compiled vars:  !0 = $userController
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   DECLARE_CLASS                                            'app%5Chttp%5Ccontrollers%5Cusercontroller', 'app%5Chttp%5Ccontrollers%5Cabstractcontroller'
   35     1        NEW                                              $1      'App%5CHttp%5CControllers%5CUserController'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   36     4        INIT_METHOD_CALL                                         !0, 'createItem'
          5        DO_FCALL                                      0          
          6      > RETURN                                                   1

Class App\Models\User:
Function builditem:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ng6bl
function name:  buildItem
number of ops:  3
compiled vars:  !0 = $param
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    9     1        ECHO                                                     !0
   10     2      > RETURN                                                   null

End of function builditem

End of class App\Models\User.

Class App\Http\Controllers\Controller: [no user functions]
Class App\Http\Controllers\UserController: [no user functions]
Class App\Http\Controllers\AbstractController:
Function createitem:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ng6bl
function name:  createItem
number of ops:  8
compiled vars:  !0 = $className
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   30     0  E >   FETCH_CLASS_CONSTANT                             ~1      'className'
          1        CONCAT                                           ~2      'App%5CModels%5C', ~1
          2        ASSIGN                                                   !0, ~2
   31     3        FETCH_CLASS                                   0  $4      !0
          4        INIT_STATIC_METHOD_CALL                                  $4, 'buildItem'
          5        SEND_VAL_EX                                              'test'
          6        DO_FCALL                                      0          
   32     7      > RETURN                                                   null

End of function createitem

End of class App\Http\Controllers\AbstractController.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
271.26 ms | 1000 KiB | 13 Q