3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { public function classMethod() { return __METHOD__; } public function loop() { $array = [0, 1, 2, 3, 4]; $ret = array_map(function($item) { return array( $item, $this->classMethod() ); }, $array); return $ret; } } $test = new Test(); $ret = $test->loop(); var_dump($ret);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Xc9Zr
function name:  (null)
number of ops:  10
compiled vars:  !0 = $test, !1 = $ret
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   27     0  E >   NEW                                              $2      'Test'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   28     3        INIT_METHOD_CALL                                         !0, 'loop'
          4        DO_FCALL                                      0  $5      
          5        ASSIGN                                                   !1, $5
   29     6        INIT_FCALL                                               'var_dump'
          7        SEND_VAR                                                 !1
          8        DO_ICALL                                                 
          9      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FXc9Zr%3A14%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Xc9Zr
function name:  {closure}
number of ops:  8
compiled vars:  !0 = $item
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV                                             !0      
   16     1        INIT_ARRAY                                       ~1      !0
   17     2        FETCH_THIS                                       $2      
          3        INIT_METHOD_CALL                                         $2, 'classMethod'
          4        DO_FCALL                                      0  $3      
          5        ADD_ARRAY_ELEMENT                                ~1      $3
          6      > RETURN                                                   ~1
   20     7*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FXc9Zr%3A14%240

Class Test:
Function classmethod:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Xc9Zr
function name:  classMethod
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E > > RETURN                                                   'Test%3A%3AclassMethod'
    8     1*     > RETURN                                                   null

End of function classmethod

Function loop:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Xc9Zr
function name:  loop
number of ops:  9
compiled vars:  !0 = $array, !1 = $ret
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   ASSIGN                                                   !0, <array>
   14     1        INIT_FCALL                                               'array_map'
          2        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FXc9Zr%3A14%240'
   20     3        SEND_VAL                                                 ~3
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $4      
   14     6        ASSIGN                                                   !1, $4
   22     7      > RETURN                                                   !1
   24     8*     > RETURN                                                   null

End of function loop

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.21 ms | 1392 KiB | 17 Q