3v4l.org

run code in 300+ PHP versions simultaneously
<?php define('KEYS', 99999); $a = array(); function fill(&$arr) { for ($i = 1; $i <= KEYS; $i++) { $arr['key-' . $i] = $i; } } function read_key(&$arr) { for ($i = 1; $i <= KEYS; $i++) { $v = $arr['key-' . $i]; } } function for_each(&$arr) { foreach ($arr as $key => $value) { $v = $value; } } fill($a); read_key($a); for_each($a);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/I4p6i
function name:  (null)
number of ops:  15
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'define'
          1        SEND_VAL                                                 'KEYS'
          2        SEND_VAL                                                 99999
          3        DO_ICALL                                                 
    5     4        ASSIGN                                                   !0, <array>
   26     5        INIT_FCALL                                               'fill'
          6        SEND_REF                                                 !0
          7        DO_FCALL                                      0          
   27     8        INIT_FCALL                                               'read_key'
          9        SEND_REF                                                 !0
         10        DO_FCALL                                      0          
   28    11        INIT_FCALL                                               'for_each'
         12        SEND_REF                                                 !0
         13        DO_FCALL                                      0          
         14      > RETURN                                                   1

Function fill:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
2 jumps found. (Code = 44) Position 1 = 10, Position 2 = 3
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 3
2 jumps found. (Code = 44) Position 1 = 10, Position 2 = 3
Branch analysis from position: 10
Branch analysis from position: 3
filename:       /in/I4p6i
function name:  fill
number of ops:  11
compiled vars:  !0 = $arr, !1 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    8     1        ASSIGN                                                   !1, 1
          2      > JMP                                                      ->7
    9     3    >   CONCAT                                           ~3      'key-', !1
          4        ASSIGN_DIM                                               !0, ~3
          5        OP_DATA                                                  !1
    8     6        PRE_INC                                                  !1
          7    >   FETCH_CONSTANT                                   ~6      'KEYS'
          8        IS_SMALLER_OR_EQUAL                                      !1, ~6
          9      > JMPNZ                                                    ~7, ->3
   11    10    > > RETURN                                                   null

End of function fill

Function read_key:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
2 jumps found. (Code = 44) Position 1 = 10, Position 2 = 3
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 3
2 jumps found. (Code = 44) Position 1 = 10, Position 2 = 3
Branch analysis from position: 10
Branch analysis from position: 3
filename:       /in/I4p6i
function name:  read_key
number of ops:  11
compiled vars:  !0 = $arr, !1 = $i, !2 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV                                             !0      
   14     1        ASSIGN                                                   !1, 1
          2      > JMP                                                      ->7
   15     3    >   CONCAT                                           ~4      'key-', !1
          4        FETCH_DIM_R                                      ~5      !0, ~4
          5        ASSIGN                                                   !2, ~5
   14     6        PRE_INC                                                  !1
          7    >   FETCH_CONSTANT                                   ~8      'KEYS'
          8        IS_SMALLER_OR_EQUAL                                      !1, ~8
          9      > JMPNZ                                                    ~9, ->3
   17    10    > > RETURN                                                   null

End of function read_key

Function for_each:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 6
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 6
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
filename:       /in/I4p6i
function name:  for_each
number of ops:  8
compiled vars:  !0 = $arr, !1 = $value, !2 = $key, !3 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   RECV                                             !0      
   20     1      > FE_RESET_R                                       $4      !0, ->6
          2    > > FE_FETCH_R                                       ~5      $4, !1, ->6
          3    >   ASSIGN                                                   !2, ~5
   21     4        ASSIGN                                                   !3, !1
   20     5      > JMP                                                      ->2
          6    >   FE_FREE                                                  $4
   23     7      > RETURN                                                   null

End of function for_each

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.26 ms | 1394 KiB | 18 Q