3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = ['1','a','b','c']; echo "$array[2]". "\n"; echo $array [4]= 'd'."\n"; echo $array[]='f'."\n"; //aasocoative array $grosery=['chocolate'=>1, 'sugar'=>10, 'salt'=>3, 'apple'=>2, 'mango'=>5]; // ['1','a','b','c'], this isn't any differnt from the one on the left echo 'Simple arrray: ' . "\n"; foreach($array as $key=>$thing) { echo $key . ' ' . $thing. "\n"; } echo 'Associative array: ' . "\n"; foreach($grosery as $key=>$thing) { //btw, it is spelled grocery echo $key . ' ' . $thing. "\n"; } // now veeeeeerrrrryyy carefuly see the difference and burn it in your mindd!
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 14, Position 2 = 21
Branch analysis from position: 14
2 jumps found. (Code = 78) Position 1 = 15, Position 2 = 21
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
Branch analysis from position: 21
2 jumps found. (Code = 77) Position 1 = 24, Position 2 = 31
Branch analysis from position: 24
2 jumps found. (Code = 78) Position 1 = 25, Position 2 = 31
Branch analysis from position: 25
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
Branch analysis from position: 31
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 31
Branch analysis from position: 21
filename:       /in/JaHtr
function name:  (null)
number of ops:  33
compiled vars:  !0 = $array, !1 = $grosery, !2 = $thing, !3 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    3     1        FETCH_DIM_R                                      ~5      !0, 2
          2        CAST                                          6  ~6      ~5
          3        CONCAT                                           ~7      ~6, '%0A'
          4        ECHO                                                     ~7
    4     5        ASSIGN_DIM                                       ~8      !0, 4
          6        OP_DATA                                                  'd%0A'
          7        ECHO                                                     ~8
    5     8        ASSIGN_DIM                                       ~9      !0
          9        OP_DATA                                                  'f%0A'
         10        ECHO                                                     ~9
    7    11        ASSIGN                                                   !1, <array>
   13    12        ECHO                                                     'Simple+arrray%3A+%0A'
   15    13      > FE_RESET_R                                       $11     !0, ->21
         14    > > FE_FETCH_R                                       ~12     $11, !2, ->21
         15    >   ASSIGN                                                   !3, ~12
   16    16        CONCAT                                           ~14     !3, '+'
         17        CONCAT                                           ~15     ~14, !2
         18        CONCAT                                           ~16     ~15, '%0A'
         19        ECHO                                                     ~16
   15    20      > JMP                                                      ->14
         21    >   FE_FREE                                                  $11
   19    22        ECHO                                                     'Associative+array%3A+%0A'
   21    23      > FE_RESET_R                                       $17     !1, ->31
         24    > > FE_FETCH_R                                       ~18     $17, !2, ->31
         25    >   ASSIGN                                                   !3, ~18
   22    26        CONCAT                                           ~20     !3, '+'
         27        CONCAT                                           ~21     ~20, !2
         28        CONCAT                                           ~22     ~21, '%0A'
         29        ECHO                                                     ~22
   21    30      > JMP                                                      ->24
         31    >   FE_FREE                                                  $17
   23    32      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.28 ms | 1395 KiB | 13 Q