3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { private $value = 5; } $x = new Foo(); $closure = function () { return $this->value; }; echo $closure->call($x);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Rh3K7
function name:  (null)
number of ops:  10
compiled vars:  !0 = $x, !1 = $closure
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   NEW                                              $2      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
    9     3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FRh3K7%3A9%240'
          4        ASSIGN                                                   !1, ~5
   10     5        INIT_METHOD_CALL                                         !1, 'call'
          6        SEND_VAR_EX                                              !0
          7        DO_FCALL                                      0  $7      
          8        ECHO                                                     $7
          9      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FRh3K7%3A9%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Rh3K7
function name:  {closure}
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   FETCH_THIS                                       $0      
          1        FETCH_OBJ_R                                      ~1      $0, 'value'
          2      > RETURN                                                   ~1
          3*     > RETURN                                                   null

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

Class Foo: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.49 ms | 1385 KiB | 13 Q