3v4l.org

run code in 300+ PHP versions simultaneously
<?php $sum = 0; $master = array(); $arrColors = array('R', 'B', 'G' ,'Y'); $arrNumbers = array('1', '2', '3', '4'); foreach($arrNumbers as $num) { foreach($arrColor as $colorK => $colorV) { $temp = $colorV.' - '.$num; if ($num != $num[$colorK]) { $sum += $num; } array_push($master, $temp); } } print_r($master); echo "\n"; print_r ("The sum is ".$sum);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 5, Position 2 = 23
Branch analysis from position: 5
2 jumps found. (Code = 78) Position 1 = 6, Position 2 = 23
Branch analysis from position: 6
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 21
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 21
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 16
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 16
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 21
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 23
filename:       /in/D22nK
function name:  (null)
number of ops:  33
compiled vars:  !0 = $sum, !1 = $master, !2 = $arrColors, !3 = $arrNumbers, !4 = $num, !5 = $arrColor, !6 = $colorV, !7 = $colorK, !8 = $temp
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 0
    3     1        ASSIGN                                                   !1, <array>
    4     2        ASSIGN                                                   !2, <array>
    5     3        ASSIGN                                                   !3, <array>
    7     4      > FE_RESET_R                                       $13     !3, ->23
          5    > > FE_FETCH_R                                               $13, !4, ->23
    8     6    > > FE_RESET_R                                       $14     !5, ->21
          7    > > FE_FETCH_R                                       ~15     $14, !6, ->21
          8    >   ASSIGN                                                   !7, ~15
    9     9        CONCAT                                           ~17     !6, '+-+'
         10        CONCAT                                           ~18     ~17, !4
         11        ASSIGN                                                   !8, ~18
   10    12        FETCH_DIM_R                                      ~20     !4, !7
         13        IS_NOT_EQUAL                                             !4, ~20
         14      > JMPZ                                                     ~21, ->16
   11    15    >   ASSIGN_OP                                     1          !0, !4
   13    16    >   INIT_FCALL                                               'array_push'
         17        SEND_REF                                                 !1
         18        SEND_VAR                                                 !8
         19        DO_ICALL                                                 
    8    20      > JMP                                                      ->7
         21    >   FE_FREE                                                  $14
    7    22      > JMP                                                      ->5
         23    >   FE_FREE                                                  $13
   18    24        INIT_FCALL                                               'print_r'
         25        SEND_VAR                                                 !1
         26        DO_ICALL                                                 
   19    27        ECHO                                                     '%0A'
   20    28        INIT_FCALL                                               'print_r'
         29        CONCAT                                           ~25     'The+sum+is+', !0
         30        SEND_VAL                                                 ~25
         31        DO_ICALL                                                 
         32      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.48 ms | 1396 KiB | 17 Q