3v4l.org

run code in 300+ PHP versions simultaneously
<?php $drinks = array("maza","coffe","coffe","coffe"); $foods = array("coffe","choco","choco","choco","appy","kurkure","maggi"); $temp=0; foreach($drinks as $drink){ //you could use foreach instead of for foreach($foods as $food){ if($drink==$food){ $temp++; } //always use brakets } echo "word count of".$drink.' is '.$temp; echo "<br/>"; } //br looks like this
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 18
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 18
Branch analysis from position: 5
2 jumps found. (Code = 77) Position 1 = 6, Position 2 = 11
Branch analysis from position: 6
2 jumps found. (Code = 78) Position 1 = 7, Position 2 = 11
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 10
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
Branch analysis from position: 10
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 11
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
filename:       /in/oQcA6
function name:  (null)
number of ops:  20
compiled vars:  !0 = $drinks, !1 = $foods, !2 = $temp, !3 = $drink, !4 = $food
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    3     1        ASSIGN                                                   !1, <array>
    4     2        ASSIGN                                                   !2, 0
    5     3      > FE_RESET_R                                       $8      !0, ->18
          4    > > FE_FETCH_R                                               $8, !3, ->18
   10     5    > > FE_RESET_R                                       $9      !1, ->11
          6    > > FE_FETCH_R                                               $9, !4, ->11
   12     7    >   IS_EQUAL                                                 !3, !4
          8      > JMPZ                                                     ~10, ->10
   13     9    >   PRE_INC                                                  !2
   10    10    > > JMP                                                      ->6
         11    >   FE_FREE                                                  $9
   17    12        CONCAT                                           ~12     'word+count+of', !3
         13        CONCAT                                           ~13     ~12, '+is+'
         14        CONCAT                                           ~14     ~13, !2
         15        ECHO                                                     ~14
   18    16        ECHO                                                     '%3Cbr%2F%3E'
    5    17      > JMP                                                      ->4
         18    >   FE_FREE                                                  $8
   20    19      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
177.42 ms | 1394 KiB | 13 Q