3v4l.org

run code in 500+ PHP versions simultaneously
<?php namespace A { class Foo { public $foo; public function __construct() { $this->foo = function (int $a) { var_dump("foo"); }; } } } namespace { ((new A\Foo)->foo)(null); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/F7R3l
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   16     0  E >   NEW                                                  $0      'A%5CFoo'
          1        DO_FCALL                                          0          
          2        FETCH_OBJ_R                                          ~2      $0, 'foo'
          3        INIT_DYNAMIC_CALL                                            ~2
          4        SEND_VAL_EX                                                  null
          5        DO_FCALL                                          0          
   17     6      > RETURN                                                       1

Class A\Foo:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/F7R3l
function name:  __construct
number of ops:  4
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    8     0  E >   DECLARE_LAMBDA_FUNCTION                              ~1      [0]
          1        ASSIGN_OBJ                                                   'foo'
   10     2        OP_DATA                                                      ~1
   11     3      > RETURN                                                       null


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/F7R3l
function name:  {closure:A\Foo::__construct():8}
number of ops:  5
compiled vars:  !0 = $a
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    8     0  E >   RECV                                                 !0      
    9     1        INIT_NS_FCALL_BY_NAME                                        'A%5Cvar_dump'
          2        SEND_VAL_EX                                                  'foo'
          3        DO_FCALL                                          0          
   10     4      > RETURN                                                       null

End of Dynamic Function 0

End of function __construct

End of class A\Foo.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
161.82 ms | 2969 KiB | 14 Q