3v4l.org

run code in 300+ PHP versions simultaneously
<?php $on_fr = true; foreach (['dev', 'staging', 'production'] as $env) { if (! in_array($env, ['dev', 'staging']) || ! ($on_fr && $env === 'production')) { echo 'This environment is invalid ' . $env . PHP_EOL; } else { echo 'This environment is valid ' . $env . PHP_EOL; } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 20
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 20
Branch analysis from position: 3
2 jumps found. (Code = 47) Position 1 = 6, Position 2 = 11
Branch analysis from position: 6
2 jumps found. (Code = 46) Position 1 = 7, Position 2 = 9
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 16
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 9
Branch analysis from position: 11
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
filename:       /in/Xdmsc
function name:  (null)
number of ops:  22
compiled vars:  !0 = $on_fr, !1 = $env
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <true>
    4     1      > FE_RESET_R                                       $3      <array>, ->20
          2    > > FE_FETCH_R                                               $3, !1, ->20
    5     3    >   IN_ARRAY                                         ~4      !1, <array>
          4        BOOL_NOT                                         ~5      ~4
          5      > JMPNZ_EX                                         ~5      ~5, ->11
          6    > > JMPZ_EX                                          ~6      !0, ->9
          7    >   IS_IDENTICAL                                     ~7      !1, 'production'
          8        BOOL                                             ~6      ~7
          9    >   BOOL_NOT                                         ~8      ~6
         10        BOOL                                             ~5      ~8
         11    > > JMPZ                                                     ~5, ->16
    6    12    >   CONCAT                                           ~9      'This+environment+is+invalid+', !1
         13        CONCAT                                           ~10     ~9, '%0A'
         14        ECHO                                                     ~10
         15      > JMP                                                      ->19
    8    16    >   CONCAT                                           ~11     'This+environment+is+valid+', !1
         17        CONCAT                                           ~12     ~11, '%0A'
         18        ECHO                                                     ~12
    4    19    > > JMP                                                      ->2
         20    >   FE_FREE                                                  $3
   10    21      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.83 ms | 1386 KiB | 13 Q