3v4l.org

run code in 300+ PHP versions simultaneously
<?php class C{ private $wtf="lol"; function f(){ $inherited="inherited"; $uninherited="uninherited"; // php lambads does not inherit variables automatically // thus to inerhit $inherited , we need use(&$inherited) call_user_func(function()use(&$inherited){ var_dump($this->wtf); var_dump($inherited); var_dump($uninherited); }); } } (new C())->f();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fbZWD
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   NEW                                              $0      'C'
          1        DO_FCALL                                      0          
          2        INIT_METHOD_CALL                                         $0, 'f'
          3        DO_FCALL                                      0          
          4      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FfbZWD%3A9%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fbZWD
function name:  {closure}
number of ops:  13
compiled vars:  !0 = $inherited, !1 = $uninherited
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   BIND_STATIC                                              !0
   10     1        INIT_FCALL                                               'var_dump'
          2        FETCH_THIS                                       $2      
          3        FETCH_OBJ_R                                      ~3      $2, 'wtf'
          4        SEND_VAL                                                 ~3
          5        DO_ICALL                                                 
   11     6        INIT_FCALL                                               'var_dump'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                                 
   12     9        INIT_FCALL                                               'var_dump'
         10        SEND_VAR                                                 !1
         11        DO_ICALL                                                 
   13    12      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FfbZWD%3A9%240

Class C:
Function f:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fbZWD
function name:  f
number of ops:  7
compiled vars:  !0 = $inherited, !1 = $uninherited
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   ASSIGN                                                   !0, 'inherited'
    6     1        ASSIGN                                                   !1, 'uninherited'
    9     2        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FfbZWD%3A9%240'
          3        BIND_LEXICAL                                             ~4, !0
   13     4        INIT_USER_CALL                                0          'call_user_func', ~4
          5        DO_FCALL                                      0          
   14     6      > RETURN                                                   null

End of function f

End of class C.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
172.4 ms | 1396 KiB | 15 Q