3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace NamespaceOne; class MyClass { function __construct( array $config ) { $func = $config['func']; $value = 'Hello World'; echo $func( $value ); // This part throws the error } } namespace NamespaceTwo; $class = new \NamespaceOne\MyClass( array( 'func' => function( $v ) { return $v; } ));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ki58v
function name:  (null)
number of ops:  7
compiled vars:  !0 = $class
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   NEW                                              $1      'NamespaceOne%5CMyClass'
   17     1        DECLARE_LAMBDA_FUNCTION                                  '%00namespacetwo%5C%7Bclosure%7D%2Fin%2Fki58v%3A17%240'
          2        INIT_ARRAY                                       ~3      ~2, 'func'
          3        SEND_VAL_EX                                              ~3
          4        DO_FCALL                                      0          
   16     5        ASSIGN                                                   !0, $1
   18     6      > RETURN                                                   1

Function %00namespacetwo%5C%7Bclosure%7D%2Fin%2Fki58v%3A17%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ki58v
function name:  NamespaceTwo\{closure}
number of ops:  3
compiled vars:  !0 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
          1      > RETURN                                                   !0
          2*     > RETURN                                                   null

End of function %00namespacetwo%5C%7Bclosure%7D%2Fin%2Fki58v%3A17%240

Class NamespaceOne\MyClass:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ki58v
function name:  __construct
number of ops:  9
compiled vars:  !0 = $config, !1 = $func, !2 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    7     1        FETCH_DIM_R                                      ~3      !0, 'func'
          2        ASSIGN                                                   !1, ~3
    8     3        ASSIGN                                                   !2, 'Hello+World'
    9     4        INIT_DYNAMIC_CALL                                        !1
          5        SEND_VAR_EX                                              !2
          6        DO_FCALL                                      0  $6      
          7        ECHO                                                     $6
   10     8      > RETURN                                                   null

End of function __construct

End of class NamespaceOne\MyClass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.21 ms | 1394 KiB | 13 Q