3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Data { public function __construct($i) { $this->i = $i; } public function getNumber() { return $this->i; } } $data = array_map(function($item) { return new Data($item); }, range(1, 100)); for ($i = 0; $i < 100; ++$i) { echo array_reduce(function ($acc, $item) { return $acc + $item->getNumber(); }, 0); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
2 jumps found. (Code = 44) Position 1 = 21, Position 2 = 12
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
2 jumps found. (Code = 44) Position 1 = 21, Position 2 = 12
Branch analysis from position: 21
Branch analysis from position: 12
filename:       /in/qN0rA
function name:  (null)
number of ops:  22
compiled vars:  !0 = $data, !1 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   INIT_FCALL                                               'array_map'
          1        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FqN0rA%3A16%240'
          2        SEND_VAL                                                 ~2
          3        INIT_FCALL                                               'range'
          4        SEND_VAL                                                 1
          5        SEND_VAL                                                 100
          6        DO_ICALL                                         $3      
          7        SEND_VAR                                                 $3
          8        DO_ICALL                                         $4      
          9        ASSIGN                                                   !0, $4
   18    10        ASSIGN                                                   !1, 0
         11      > JMP                                                      ->19
   19    12    >   INIT_FCALL                                               'array_reduce'
         13        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FqN0rA%3A19%241'
         14        SEND_VAL                                                 ~7
         15        SEND_VAL                                                 0
         16        DO_ICALL                                         $8      
         17        ECHO                                                     $8
   18    18        PRE_INC                                                  !1
         19    >   IS_SMALLER                                               !1, 100
         20      > JMPNZ                                                    ~10, ->12
   20    21    > > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FqN0rA%3A16%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qN0rA
function name:  {closure}
number of ops:  6
compiled vars:  !0 = $item
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   RECV                                             !0      
          1        NEW                                              $1      'Data'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0          
          4      > RETURN                                                   $1
          5*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FqN0rA%3A16%240

Function %00%7Bclosure%7D%2Fin%2FqN0rA%3A19%241:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qN0rA
function name:  {closure}
number of ops:  7
compiled vars:  !0 = $acc, !1 = $item
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        INIT_METHOD_CALL                                         !1, 'getNumber'
          3        DO_FCALL                                      0  $2      
          4        ADD                                              ~3      !0, $2
          5      > RETURN                                                   ~3
          6*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FqN0rA%3A19%241

Class Data:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qN0rA
function name:  __construct
number of ops:  4
compiled vars:  !0 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    7     1        ASSIGN_OBJ                                               'i'
          2        OP_DATA                                                  !0
    8     3      > RETURN                                                   null

End of function __construct

Function getnumber:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qN0rA
function name:  getNumber
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   FETCH_OBJ_R                                      ~0      'i'
          1      > RETURN                                                   ~0
   13     2*     > RETURN                                                   null

End of function getnumber

End of class Data.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154 ms | 1400 KiB | 19 Q