3v4l.org

run code in 300+ PHP versions simultaneously
<?php class x { private $p = 'secret'; } $o = new x; $f = function(){ return $this->p; }; $g = $f; echo $f->__invoke(),"\n"; echo $f(),"\n"; echo $f->call($o);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hSGvj
function name:  (null)
number of ops:  19
compiled vars:  !0 = $o, !1 = $f, !2 = $g
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   NEW                                              $3      'x'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $3
    6     3        DECLARE_LAMBDA_FUNCTION                          ~6      [0]
          4        ASSIGN                                                   !1, ~6
    7     5        ASSIGN                                                   !2, !1
    8     6        INIT_METHOD_CALL                                         !1, '__invoke'
          7        DO_FCALL                                      0  $9      
          8        ECHO                                                     $9
          9        ECHO                                                     '%0A'
    9    10        INIT_DYNAMIC_CALL                                        !1
         11        DO_FCALL                                      0  $10     
         12        ECHO                                                     $10
         13        ECHO                                                     '%0A'
   10    14        INIT_METHOD_CALL                                         !1, 'call'
         15        SEND_VAR_EX                                              !0
         16        DO_FCALL                                      0  $11     
         17        ECHO                                                     $11
         18      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hSGvj
function name:  {closure}
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   FETCH_THIS                                       $0      
          1        FETCH_OBJ_R                                      ~1      $0, 'p'
          2      > RETURN                                                   ~1
          3*     > RETURN                                                   null

End of Dynamic Function 0

Class x: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
139.1 ms | 1434 KiB | 13 Q