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, $n = 0; $i < 100; ++$i) { foreach ($data as $item) { ++$n; } }
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 = 13
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
2 jumps found. (Code = 77) Position 1 = 14, Position 2 = 17
Branch analysis from position: 14
2 jumps found. (Code = 78) Position 1 = 15, Position 2 = 17
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
Branch analysis from position: 17
2 jumps found. (Code = 44) Position 1 = 21, Position 2 = 13
Branch analysis from position: 21
Branch analysis from position: 13
Branch analysis from position: 17
filename:       /in/91144
function name:  (null)
number of ops:  22
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%2F91144%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        ASSIGN                                                   !2, 0
         12      > JMP                                                      ->19
   19    13    > > FE_RESET_R                                       $10     !0, ->17
         14    > > FE_FETCH_R                                               $10, !3, ->17
   20    15    >   PRE_INC                                                  !2
   19    16      > JMP                                                      ->14
         17    >   FE_FREE                                                  $10
   18    18        PRE_INC                                                  !1
         19    >   IS_SMALLER                                               !1, 100
         20      > JMPNZ                                                    ~13, ->13
   22    21    > > RETURN                                                   1

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

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