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 < 10000; ++$i) { echo array_reduce($data, function ($acc, $item) { return $acc + $item->getNumber(); }, 0); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
2 jumps found. (Code = 44) Position 1 = 22, Position 2 = 12
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
2 jumps found. (Code = 44) Position 1 = 22, Position 2 = 12
Branch analysis from position: 22
Branch analysis from position: 12
filename:       /in/uJdkk
function name:  (null)
number of ops:  23
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%2FuJdkk%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                                                      ->20
   19    12    >   INIT_FCALL                                               'array_reduce'
         13        SEND_VAR                                                 !0
         14        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FuJdkk%3A19%241'
         15        SEND_VAL                                                 ~7
         16        SEND_VAL                                                 0
         17        DO_ICALL                                         $8      
         18        ECHO                                                     $8
   18    19        PRE_INC                                                  !1
         20    >   IS_SMALLER                                               !1, 10000
         21      > JMPNZ                                                    ~10, ->12
   20    22    > > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FuJdkk%3A16%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/uJdkk
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%2FuJdkk%3A16%240

Function %00%7Bclosure%7D%2Fin%2FuJdkk%3A19%241:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/uJdkk
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%2FuJdkk%3A19%241

Class Data:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/uJdkk
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/uJdkk
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:
153.38 ms | 1392 KiB | 19 Q