3v4l.org

run code in 300+ PHP versions simultaneously
<?php final class DemoFile { public function run() { $test = 'Super'; $this->myCallback( function () use ($test) { return compact('test'); } ); } private function myCallback($callback) { var_dump($callback()); } } $d = new DemoFile(); $d->run();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/C2u7X
function name:  (null)
number of ops:  6
compiled vars:  !0 = $d
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   NEW                                              $1      'DemoFile'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   23     3        INIT_METHOD_CALL                                         !0, 'run'
          4        DO_FCALL                                      0          
          5      > RETURN                                                   1

Class DemoFile:
Function run:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/C2u7X
function name:  run
number of ops:  7
compiled vars:  !0 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   ASSIGN                                                   !0, 'Super'
    9     1        INIT_METHOD_CALL                                         'myCallback'
   10     2        DECLARE_LAMBDA_FUNCTION                          ~2      [0]
          3        BIND_LEXICAL                                             ~2, !0
   12     4        SEND_VAL_EX                                              ~2
    9     5        DO_FCALL                                      0          
   14     6      > 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/C2u7X
function name:  {closure}
number of ops:  6
compiled vars:  !0 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   BIND_STATIC                                              !0
   11     1        INIT_FCALL                                               'compact'
          2        SEND_VAL                                                 'test'
          3        DO_ICALL                                         $1      
          4      > RETURN                                                   $1
   12     5*     > RETURN                                                   null

End of Dynamic Function 0

End of function run

Function mycallback:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/C2u7X
function name:  myCallback
number of ops:  7
compiled vars:  !0 = $callback
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   RECV                                             !0      
   18     1        INIT_FCALL                                               'var_dump'
          2        INIT_DYNAMIC_CALL                                        !0
          3        DO_FCALL                                      0  $1      
          4        SEND_VAR                                                 $1
          5        DO_ICALL                                                 
   19     6      > RETURN                                                   null

End of function mycallback

End of class DemoFile.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.4 ms | 1015 KiB | 15 Q