3v4l.org

run code in 300+ PHP versions simultaneously
<?php function check($players1, $confirm1, $players2, $confirm2){ if ($players1 === NULL and $confirm1 === 0) { return 1; } elseif ($players1 !== NULL and $confirm1 === 1 and $players2 === NULL and $confirm2 === 0) { return 2; } else { return 3; } } $tests = [ [null, 0, null, null], [1,1, null, 0], [1, null, null, null], [1,1,1,1], ]; foreach($tests as $test){ var_dump(check(...$test)); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 11
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 11
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
filename:       /in/tg5UQ
function name:  (null)
number of ops:  13
compiled vars:  !0 = $tests, !1 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   ASSIGN                                                   !0, <array>
   20     1      > FE_RESET_R                                       $3      !0, ->11
          2    > > FE_FETCH_R                                               $3, !1, ->11
   21     3    >   INIT_FCALL                                               'var_dump'
          4        INIT_FCALL                                               'check'
          5        SEND_UNPACK                                              !1
          6        CHECK_UNDEF_ARGS                                         
          7        DO_FCALL                                      1  $4      
          8        SEND_VAR                                                 $4
          9        DO_ICALL                                                 
   20    10      > JMP                                                      ->2
         11    >   FE_FREE                                                  $3
   22    12      > RETURN                                                   1

Function check:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 6, Position 2 = 8
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 11
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
2 jumps found. (Code = 46) Position 1 = 13, Position 2 = 15
Branch analysis from position: 13
2 jumps found. (Code = 46) Position 1 = 16, Position 2 = 18
Branch analysis from position: 16
2 jumps found. (Code = 46) Position 1 = 19, Position 2 = 21
Branch analysis from position: 19
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 24
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
Branch analysis from position: 18
Branch analysis from position: 15
Branch analysis from position: 8
filename:       /in/tg5UQ
function name:  check
number of ops:  26
compiled vars:  !0 = $players1, !1 = $confirm1, !2 = $players2, !3 = $confirm2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
          3        RECV                                             !3      
    4     4        TYPE_CHECK                                    2  ~4      !0
          5      > JMPZ_EX                                          ~4      ~4, ->8
          6    >   IS_IDENTICAL                                     ~5      !1, 0
          7        BOOL                                             ~4      ~5
          8    > > JMPZ                                                     ~4, ->11
    5     9    > > RETURN                                                   1
         10*       JMP                                                      ->25
    6    11    >   TYPE_CHECK                                  1020  ~6      !0
         12      > JMPZ_EX                                          ~6      ~6, ->15
         13    >   IS_IDENTICAL                                     ~7      !1, 1
         14        BOOL                                             ~6      ~7
         15    > > JMPZ_EX                                          ~6      ~6, ->18
         16    >   TYPE_CHECK                                    2  ~8      !2
         17        BOOL                                             ~6      ~8
         18    > > JMPZ_EX                                          ~6      ~6, ->21
         19    >   IS_IDENTICAL                                     ~9      !3, 0
         20        BOOL                                             ~6      ~9
         21    > > JMPZ                                                     ~6, ->24
    7    22    > > RETURN                                                   2
         23*       JMP                                                      ->25
    9    24    > > RETURN                                                   3
   11    25*     > RETURN                                                   null

End of function check

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
172.21 ms | 1403 KiB | 16 Q