3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace NS { class C { public $fn; public function __construct() { $this->fn = function (string $arg) { var_dump("fn"); }; } } } namespace { $fn = (new NS\C)->fn; $fn("null"); echo "Done\n"; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6pNY6
function name:  (null)
number of ops:  9
compiled vars:  !0 = $fn
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   NEW                                              $1      'NS%5CC'
          1        DO_FCALL                                      0          
          2        FETCH_OBJ_R                                      ~3      $1, 'fn'
          3        ASSIGN                                                   !0, ~3
   17     4        INIT_DYNAMIC_CALL                                        !0
          5        SEND_VAL_EX                                              'null'
          6        DO_FCALL                                      0          
   18     7        ECHO                                                     'Done%0A'
   19     8      > RETURN                                                   1

Function %00ns%5C%7Bclosure%7D%2Fin%2F6pNY6%3A8%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6pNY6
function name:  NS\{closure}
number of ops:  5
compiled vars:  !0 = $arg
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
    9     1        INIT_NS_FCALL_BY_NAME                                    'NS%5Cvar_dump'
          2        SEND_VAL_EX                                              'fn'
          3        DO_FCALL                                      0          
   10     4      > RETURN                                                   null

End of function %00ns%5C%7Bclosure%7D%2Fin%2F6pNY6%3A8%240

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

End of function __construct

End of class NS\C.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
176.71 ms | 1395 KiB | 15 Q