3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public function testAnonFunc() { $testArray = array(1, 2, 3); $result = array_map( function ($x, $y) { $x = $x + 1; return $x; }, $testArray ); return $result; } } $a = new A(); print_r($a->testAnonFunc());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/siAM4
function name:  (null)
number of ops:  9
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   27     0  E >   NEW                                              $1      'A'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   29     3        INIT_FCALL                                               'print_r'
          4        INIT_METHOD_CALL                                         !0, 'testAnonFunc'
          5        DO_FCALL                                      0  $4      
          6        SEND_VAR                                                 $4
          7        DO_ICALL                                                 
          8      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FsiAM4%3A10%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/siAM4
function name:  {closure}
number of ops:  6
compiled vars:  !0 = $x, !1 = $y
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   12     2        ADD                                              ~2      !0, 1
          3        ASSIGN                                                   !0, ~2
   13     4      > RETURN                                                   !0
   15     5*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FsiAM4%3A10%240

Class A:
Function testanonfunc:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/siAM4
function name:  testAnonFunc
number of ops:  9
compiled vars:  !0 = $testArray, !1 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   ASSIGN                                                   !0, <array>
    9     1        INIT_FCALL                                               'array_map'
   10     2        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FsiAM4%3A10%240'
   15     3        SEND_VAL                                                 ~3
   16     4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $4      
    9     6        ASSIGN                                                   !1, $4
   20     7      > RETURN                                                   !1
   22     8*     > RETURN                                                   null

End of function testanonfunc

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.49 ms | 1388 KiB | 17 Q