3v4l.org

run code in 500+ PHP versions simultaneously
<?php class Foo { private $one = "two"; public function bar() { return function() { return $this->one; }; } } $f = new Foo(); $b = $f->bar(); echo $b();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/oM0Pc
function name:  (null)
number of ops:  10
compiled vars:  !0 = $f, !1 = $b
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   15     0  E >   NEW                                                  $2      'Foo'
          1        DO_FCALL                                          0          
          2        ASSIGN                                                       !0, $2
   16     3        INIT_METHOD_CALL                                             !0, 'bar'
          4        DO_FCALL                                          0  $5      
          5        ASSIGN                                                       !1, $5
   17     6        INIT_DYNAMIC_CALL                                            !1
          7        DO_FCALL                                          0  $7      
          8        ECHO                                                         $7
          9      > RETURN                                                       1

Class Foo:
Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/oM0Pc
function name:  bar
number of ops:  3
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    8     0  E >   DECLARE_LAMBDA_FUNCTION                              ~0      [0]
   10     1      > RETURN                                                       ~0
   11     2*     > 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/oM0Pc
function name:  {closure:Foo::bar():8}
number of ops:  3
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    9     0  E >   FETCH_OBJ_R                                          ~0      'one'
          1      > RETURN                                                       ~0
   10     2*     > RETURN                                                       null

End of Dynamic Function 0

End of function bar

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
226.09 ms | 3032 KiB | 13 Q