3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public function main() { $arr = array(2, 4); array_map(function($a) { $this->bar($a); }, $arr); } private function bar($val) { echo "Private bar(): $val\n"; } } $foo = new Foo(); $foo->main();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gvIgS
function name:  (null)
number of ops:  6
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   NEW                                              $1      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   19     3        INIT_METHOD_CALL                                         !0, 'main'
          4        DO_FCALL                                      0          
          5      > RETURN                                                   1

Class Foo:
Function main:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gvIgS
function name:  main
number of ops:  7
compiled vars:  !0 = $arr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   ASSIGN                                                   !0, <array>
    7     1        INIT_FCALL                                               'array_map'
          2        DECLARE_LAMBDA_FUNCTION                          ~2      [0]
    9     3        SEND_VAL                                                 ~2
          4        SEND_VAR                                                 !0
    7     5        DO_ICALL                                                 
   10     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/gvIgS
function name:  {closure}
number of ops:  6
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    8     1        FETCH_THIS                                       $1      
          2        INIT_METHOD_CALL                                         $1, 'bar'
          3        SEND_VAR_EX                                              !0
          4        DO_FCALL                                      0          
    9     5      > RETURN                                                   null

End of Dynamic Function 0

End of function main

Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gvIgS
function name:  bar
number of ops:  6
compiled vars:  !0 = $val
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
   13     1        ROPE_INIT                                     3  ~2      'Private+bar%28%29%3A+'
          2        ROPE_ADD                                      1  ~2      ~2, !0
          3        ROPE_END                                      2  ~1      ~2, '%0A'
          4        ECHO                                                     ~1
   14     5      > RETURN                                                   null

End of function bar

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.75 ms | 1011 KiB | 14 Q