3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public function testAnonFunc() { $testArray = array(1, 2, 3); $testArray2 = array(10, 20, 30); $result = array_map( function ($x, $y) { $x = $x + 1; return $x; }, $testArray, $testArray2 ); 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/XkhBe
function name:  (null)
number of ops:  9
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   29     0  E >   NEW                                              $1      'A'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   31     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%2FXkhBe%3A11%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XkhBe
function name:  {closure}
number of ops:  6
compiled vars:  !0 = $x, !1 = $y
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   13     2        ADD                                              ~2      !0, 1
          3        ASSIGN                                                   !0, ~2
   14     4      > RETURN                                                   !0
   16     5*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FXkhBe%3A11%240

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

End of function testanonfunc

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.85 ms | 1396 KiB | 17 Q