3v4l.org

run code in 300+ PHP versions simultaneously
<?php class ClosureTest { public function closuretest() { $this->testing = 'hello'; $test = function() { echo $this->testing; }; $test(); } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/oI8Cu
function name:  (null)
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E > > RETURN                                                   1

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

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

Class ClosureTest:
Function closuretest:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/oI8Cu
function name:  closuretest
number of ops:  7
compiled vars:  !0 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   ASSIGN_OBJ                                               'testing'
          1        OP_DATA                                                  'hello'
    9     2        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FoI8Cu%3A9%240'
          3        ASSIGN                                                   !0, ~2
   10     4        INIT_DYNAMIC_CALL                                        !0
          5        DO_FCALL                                      0          
   11     6      > RETURN                                                   null

End of function closuretest

End of class ClosureTest.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.12 ms | 1394 KiB | 13 Q