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) { $n = 0; foreach ($data as $item) { $n += $item->getNumber(); } echo $n; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
2 jumps found. (Code = 44) Position 1 = 24, Position 2 = 12
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
2 jumps found. (Code = 77) Position 1 = 14, Position 2 = 19
Branch analysis from position: 14
2 jumps found. (Code = 78) Position 1 = 15, Position 2 = 19
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
Branch analysis from position: 19
2 jumps found. (Code = 44) Position 1 = 24, Position 2 = 12
Branch analysis from position: 24
Branch analysis from position: 12
Branch analysis from position: 19
filename:       /in/vOWs6
function name:  (null)
number of ops:  25
compiled vars:  !0 = $data, !1 = $i, !2 = $n, !3 = $item
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   INIT_FCALL                                               'array_map'
          1        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FvOWs6%3A16%240'
          2        SEND_VAL                                                 ~4
          3        INIT_FCALL                                               'range'
          4        SEND_VAL                                                 1
          5        SEND_VAL                                                 100
          6        DO_ICALL                                         $5      
          7        SEND_VAR                                                 $5
          8        DO_ICALL                                         $6      
          9        ASSIGN                                                   !0, $6
   18    10        ASSIGN                                                   !1, 0
         11      > JMP                                                      ->22
   19    12    >   ASSIGN                                                   !2, 0
   20    13      > FE_RESET_R                                       $10     !0, ->19
         14    > > FE_FETCH_R                                               $10, !3, ->19
   21    15    >   INIT_METHOD_CALL                                         !3, 'getNumber'
         16        DO_FCALL                                      0  $11     
         17        ASSIGN_OP                                     1          !2, $11
   20    18      > JMP                                                      ->14
         19    >   FE_FREE                                                  $10
   23    20        ECHO                                                     !2
   18    21        PRE_INC                                                  !1
         22    >   IS_SMALLER                                               !1, 10000
         23      > JMPNZ                                                    ~14, ->12
   24    24    > > RETURN                                                   1

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

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