3v4l.org

run code in 500+ PHP versions simultaneously
<?php function inspect($object, $property) { return (function () use ($property) { return $this->$property; })->call($object); } class Foo { private $bar = "hands off!"; } var_dump(inspect(new Foo(), "bar"));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lqZBd
function name:  (null)
number of ops:  10
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   13     0  E >   INIT_FCALL                                                   'var_dump'
          1        INIT_FCALL                                                   'inspect'
          2        NEW                                                  $0      'Foo'
          3        DO_FCALL                                          0          
          4        SEND_VAR                                                     $0
          5        SEND_VAL                                                     'bar'
          6        DO_FCALL                                          0  $2      
          7        SEND_VAR                                                     $2
          8        DO_ICALL                                                     
          9      > RETURN                                                       1

Function inspect:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lqZBd
function name:  inspect
number of ops:  9
compiled vars:  !0 = $object, !1 = $property
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
    4     2        DECLARE_LAMBDA_FUNCTION                              ~2      [0]
          3        BIND_LEXICAL                                                 ~2, !1
    6     4        INIT_METHOD_CALL                                             ~2, 'call'
          5        SEND_VAR_EX                                                  !0
          6        DO_FCALL                                          0  $3      
          7      > RETURN                                                       $3
    7     8*     > 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/lqZBd
function name:  {closure:inspect():4}
number of ops:  5
compiled vars:  !0 = $property
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    4     0  E >   BIND_STATIC                                                  !0
    5     1        FETCH_THIS                                           $1      
          2        FETCH_OBJ_R                                          ~2      $1, !0
          3      > RETURN                                                       ~2
    6     4*     > RETURN                                                       null

End of Dynamic Function 0

End of function inspect

Class Foo: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
170.13 ms | 3299 KiB | 15 Q