3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $eggCount = 3; for($i = 1; $i <= $eggCount; $i++) { create("eggs", array($i => array("ID" => $i))); } function create($arrName, Array $arrKeys) { $lName = "$".strtolower($arrName); $$lName = array(array()); foreach($arrKeys as $key => $value) { $$lName[$key] = $value; } for($i = 1; $i <= $GLOBALS['eggCount']; $i++) { //echo "Egg $i's ID: " . $$lName[$i]; } print_r($$lName[0]); }
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = 11
Branch analysis from position: 11
Jump found. Position 1 = 13, Position 2 = 3
Branch analysis from position: 13
Jump found. Position 1 = -2
Branch analysis from position: 3
Jump found. Position 1 = 13, Position 2 = 3
Branch analysis from position: 13
Branch analysis from position: 3
filename:       /in/44gjd
function name:  (null)
number of ops:  15
compiled vars:  !0 = $eggCount, !1 = $i
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   3     0  E >   ASSIGN                                                   !0, 3
   5     1        ASSIGN                                                   !1, 1
         2      > JMP                                                      ->11
   6     3    >   INIT_FCALL_BY_NAME                                       'create'
         4        SEND_VAL_EX                                              'eggs'
         5        INIT_ARRAY                                       ~4      !1, 'ID'
         6        INIT_ARRAY                                       ~5      ~4, !1
         7        SEND_VAL_EX                                              ~5
         8        DO_FCALL                                      0          
   5     9        POST_INC                                         ~7      !1
        10        FREE                                                     ~7
        11    >   IS_SMALLER_OR_EQUAL                              ~8      !1, !0
        12      > JMPNZ                                                    ~8, ->3
   9    13    >   NOP                                                      
  19    14      > RETURN                                                   1

Function create:
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = 10, Position 2 = 16
Branch analysis from position: 10
Jump found. Position 1 = 11, Position 2 = 16
Branch analysis from position: 11
Jump found. Position 1 = 10
Branch analysis from position: 10
Branch analysis from position: 16
Jump found. Position 1 = 21
Branch analysis from position: 21
Jump found. Position 1 = 25, Position 2 = 19
Branch analysis from position: 25
Jump found. Position 1 = -2
Branch analysis from position: 19
Jump found. Position 1 = 25, Position 2 = 19
Branch analysis from position: 25
Branch analysis from position: 19
Branch analysis from position: 16
filename:       /in/44gjd
function name:  create
number of ops:  31
compiled vars:  !0 = $arrName, !1 = $arrKeys, !2 = $lName, !3 = $value, !4 = $key, !5 = $i
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   9     0  E >   RECV                                             !0      
         1        RECV                                             !1      
  10     2        INIT_FCALL                                               'strtolower'
         3        SEND_VAR                                                 !0
         4        DO_ICALL                                         $6      
         5        CONCAT                                           ~7      '%24', $6
         6        ASSIGN                                                   !2, ~7
  11     7        FETCH_W                      local               $9      !2
         8        ASSIGN                                                   $9, <array>
  12     9      > FE_RESET_R                                       $11     !1, ->16
        10    > > FE_FETCH_R                                       ~12     $11, !3, ->16
        11    >   ASSIGN                                                   !4, ~12
  13    12        FETCH_W                      local               $14     !2
        13        ASSIGN_DIM                                               $14, !4
        14        OP_DATA                                                  !3
        15      > JMP                                                      ->10
        16    >   FE_FREE                                                  $11
  15    17        ASSIGN                                                   !5, 1
        18      > JMP                                                      ->21
        19    >   POST_INC                                         ~17     !5
        20        FREE                                                     ~17
        21    >   FETCH_R                      global              $18     'GLOBALS'
        22        FETCH_DIM_R                                      $19     $18, 'eggCount'
        23        IS_SMALLER_OR_EQUAL                              ~20     !5, $19
        24      > JMPNZ                                                    ~20, ->19
  18    25    >   INIT_FCALL                                               'print_r'
        26        FETCH_R                      local               $21     !2
        27        FETCH_DIM_R                                      $22     $21, 0
        28        SEND_VAR                                                 $22
        29        DO_ICALL                                                 
  19    30      > RETURN                                                   null

End of function create

Generated using Vulcan Logic Dumper, using php 7.2.0