3v4l.org

run code in 300+ 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); echo "Done\n"; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/tDjfk
function name:  (null)
number of ops:  8
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        ECHO                                                     'Done%0A'
   18     7      > RETURN                                                   1

Function %00a%5C%7Bclosure%7D%2Fin%2FtDjfk%3A8%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/tDjfk
function name:  A\{closure}
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 function %00a%5C%7Bclosure%7D%2Fin%2FtDjfk%3A8%240

Class A\Foo:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/tDjfk
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                                  '%00a%5C%7Bclosure%7D%2Fin%2FtDjfk%3A8%240'
          1        ASSIGN_OBJ                                               'foo'
   10     2        OP_DATA                                                  ~1
   11     3      > RETURN                                                   null

End of function __construct

End of class A\Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.54 ms | 1395 KiB | 15 Q