3v4l.org

run code in 300+ 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

Function %00%7Bclosure%7D%2Fin%2FoM0Pc%3A8%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/oM0Pc
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, 'one'
          2      > RETURN                                                   ~1
   10     3*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FoM0Pc%3A8%240

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                                  '%00%7Bclosure%7D%2Fin%2FoM0Pc%3A8%240'
   10     1      > RETURN                                                   ~0
   11     2*     > RETURN                                                   null

End of function bar

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
172.81 ms | 1394 KiB | 13 Q