3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace HookInvoker\FileSystem { class PhpFunctionProducer { const FUNCTION_CODE = <<<PHP <?php /** * This function wau auto created, pleaee do not edit */ function :function: () { return \DrupalContainer\Registry::getContainer() ->get(':class:') ->hook(func_get_args()); } PHP; public function getPhpFunctionCode() { return self::FUNCTION_CODE; } public function create($function) { $code = str_replace( [':function:', ':class:'], [$function, 'module.test.init'], $this->getPhpFunctionCode()); echo $code; } } } namespace { $x = new HookInvoker\FileSystem\PhpFunctionProducer(); $x->create('test_init'); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dVJsd
function name:  (null)
number of ops:  7
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   36     0  E >   NEW                                              $1      'HookInvoker%5CFileSystem%5CPhpFunctionProducer'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   37     3        INIT_METHOD_CALL                                         !0, 'create'
          4        SEND_VAL_EX                                              'test_init'
          5        DO_FCALL                                      0          
   39     6      > RETURN                                                   1

Class HookInvoker\FileSystem\PhpFunctionProducer:
Function getphpfunctioncode:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dVJsd
function name:  getPhpFunctionCode
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   FETCH_CLASS_CONSTANT                             ~0      'FUNCTION_CODE'
          1      > RETURN                                                   ~0
   21     2*     > RETURN                                                   null

End of function getphpfunctioncode

Function create:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dVJsd
function name:  create
number of ops:  13
compiled vars:  !0 = $function, !1 = $code
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   RECV                                             !0      
   24     1        INIT_NS_FCALL_BY_NAME                                    'HookInvoker%5CFileSystem%5Cstr_replace'
   25     2        SEND_VAL_EX                                              <array>
   26     3        INIT_ARRAY                                       ~2      !0
          4        ADD_ARRAY_ELEMENT                                ~2      'module.test.init'
          5        SEND_VAL_EX                                              ~2
   27     6        INIT_METHOD_CALL                                         'getPhpFunctionCode'
          7        DO_FCALL                                      0  $3      
          8        SEND_VAR_NO_REF_EX                                       $3
          9        DO_FCALL                                      0  $4      
   24    10        ASSIGN                                                   !1, $4
   29    11        ECHO                                                     !1
   30    12      > RETURN                                                   null

End of function create

End of class HookInvoker\FileSystem\PhpFunctionProducer.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
137.15 ms | 1388 KiB | 15 Q