3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $sum = 0; $master = array(); $arrColors = array('R', 'B', 'G' ,'Y'); $arrNumbers = array('1', '2', '3', '4'); foreach($arrColors as $num) { foreach($arrNumbers as $color) { $temp = $color.' - '.$num; if ($num != $num) { $sum+= $num; } array_push($master, $temp); } } print_r($master); echo "\n"; print_r ("The sum is ".$sum);
based on 0JXYk
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = 5, Position 2 = 21
Branch analysis from position: 5
Jump found. Position 1 = 6, Position 2 = 21
Branch analysis from position: 6
Jump found. Position 1 = 7, Position 2 = 19
Branch analysis from position: 7
Jump found. Position 1 = 8, Position 2 = 19
Branch analysis from position: 8
Jump found. Position 1 = 13, Position 2 = 14
Branch analysis from position: 13
Jump found. Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 14
Branch analysis from position: 19
Jump found. Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 19
Branch analysis from position: 21
Jump found. Position 1 = -2
Branch analysis from position: 21
filename:       /in/RT0jF
function name:  (null)
number of ops:  31
compiled vars:  !0 = $sum, !1 = $master, !2 = $arrColors, !3 = $arrNumbers, !4 = $num, !5 = $color, !6 = $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                                       $11     !2, ->21
         5    > > FE_FETCH_R                                               $11, !4, ->21
   8     6    > > FE_RESET_R                                       $12     !3, ->19
         7    > > FE_FETCH_R                                               $12, !5, ->19
   9     8    >   CONCAT                                           ~13     !5, '+-+'
         9        CONCAT                                           ~14     ~13, !4
        10        ASSIGN                                                   !6, ~14
  10    11        IS_NOT_EQUAL                                     ~16     !4, !4
        12      > JMPZ                                                     ~16, ->14
  11    13    >   ASSIGN_ADD                                    0          !0, !4
  13    14    >   INIT_FCALL                                               'array_push'
        15        SEND_REF                                                 !1
        16        SEND_VAR                                                 !6
        17        DO_ICALL                                                 
        18      > JMP                                                      ->7
        19    >   FE_FREE                                                  $12
        20      > JMP                                                      ->5
        21    >   FE_FREE                                                  $11
  18    22        INIT_FCALL                                               'print_r'
        23        SEND_VAR                                                 !1
        24        DO_ICALL                                                 
  19    25        ECHO                                                     '%0A'
  20    26        INIT_FCALL                                               'print_r'
        27        CONCAT                                           ~20     'The+sum+is+', !0
        28        SEND_VAL                                                 ~20
        29        DO_ICALL                                                 
        30      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 7.2.0