3v4l.org

run code in 300+ PHP versions simultaneously
<?php class ClosureTest { public function closuretestt() { $this->testing = 'hello'; $test = function() { echo $this->testing; }; $test(); } } $test = new ClosureTest(); echo "woot"; $test->closuretest();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GpKTB
function name:  (null)
number of ops:  7
compiled vars:  !0 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   NEW                                              $1      'ClosureTest'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   15     3        ECHO                                                     'woot'
   16     4        INIT_METHOD_CALL                                         !0, 'closuretest'
          5        DO_FCALL                                      0          
          6      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FGpKTB%3A9%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GpKTB
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%2FGpKTB%3A9%240

Class ClosureTest:
Function closuretestt:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GpKTB
function name:  closuretestt
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%2FGpKTB%3A9%240'
          3        ASSIGN                                                   !0, ~2
   10     4        INIT_DYNAMIC_CALL                                        !0
          5        DO_FCALL                                      0          
   11     6      > RETURN                                                   null

End of function closuretestt

End of class ClosureTest.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.24 ms | 1394 KiB | 13 Q