3v4l.org

run code in 300+ PHP versions simultaneously
<?php $return = []; $status = "None"; $sql = array( array("status" => "Placed"), array("status" => "Pending"), array("status" => "Pending") ); foreach ($sql as $value) { $return[] = $value["status"]; } print_r($return); if(in_array("Pending", $return)) { $status = "Pending"; } if(in_array("Placed", $return) and !in_array("Pending", $return)) { $status = "Placed"; } if(in_array("Received", $return) and in_array("Placed", $return)) { $status = "Received"; } print_r($status);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 9
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 9
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 18, Position 2 = 19
Branch analysis from position: 18
2 jumps found. (Code = 46) Position 1 = 24, Position 2 = 30
Branch analysis from position: 24
2 jumps found. (Code = 43) Position 1 = 31, Position 2 = 32
Branch analysis from position: 31
2 jumps found. (Code = 46) Position 1 = 37, Position 2 = 42
Branch analysis from position: 37
2 jumps found. (Code = 43) Position 1 = 43, Position 2 = 44
Branch analysis from position: 43
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 44
Branch analysis from position: 42
Branch analysis from position: 32
Branch analysis from position: 30
Branch analysis from position: 19
Branch analysis from position: 9
filename:       /in/M0rQB
function name:  (null)
number of ops:  48
compiled vars:  !0 = $return, !1 = $status, !2 = $sql, !3 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, 'None'
    5     2        ASSIGN                                                   !2, <array>
   11     3      > FE_RESET_R                                       $7      !2, ->9
          4    > > FE_FETCH_R                                               $7, !3, ->9
   13     5    >   FETCH_DIM_R                                      ~9      !3, 'status'
          6        ASSIGN_DIM                                               !0
          7        OP_DATA                                                  ~9
   11     8      > JMP                                                      ->4
          9    >   FE_FREE                                                  $7
   16    10        INIT_FCALL                                               'print_r'
         11        SEND_VAR                                                 !0
         12        DO_ICALL                                                 
   18    13        INIT_FCALL                                               'in_array'
         14        SEND_VAL                                                 'Pending'
         15        SEND_VAR                                                 !0
         16        DO_ICALL                                         $11     
         17      > JMPZ                                                     $11, ->19
   20    18    >   ASSIGN                                                   !1, 'Pending'
   23    19    >   INIT_FCALL                                               'in_array'
         20        SEND_VAL                                                 'Placed'
         21        SEND_VAR                                                 !0
         22        DO_ICALL                                         $13     
         23      > JMPZ_EX                                          ~14     $13, ->30
         24    >   INIT_FCALL                                               'in_array'
         25        SEND_VAL                                                 'Pending'
         26        SEND_VAR                                                 !0
         27        DO_ICALL                                         $15     
         28        BOOL_NOT                                         ~16     $15
         29        BOOL                                             ~14     ~16
         30    > > JMPZ                                                     ~14, ->32
   25    31    >   ASSIGN                                                   !1, 'Placed'
   28    32    >   INIT_FCALL                                               'in_array'
         33        SEND_VAL                                                 'Received'
         34        SEND_VAR                                                 !0
         35        DO_ICALL                                         $18     
         36      > JMPZ_EX                                          ~19     $18, ->42
         37    >   INIT_FCALL                                               'in_array'
         38        SEND_VAL                                                 'Placed'
         39        SEND_VAR                                                 !0
         40        DO_ICALL                                         $20     
         41        BOOL                                             ~19     $20
         42    > > JMPZ                                                     ~19, ->44
   30    43    >   ASSIGN                                                   !1, 'Received'
   33    44    >   INIT_FCALL                                               'print_r'
         45        SEND_VAR                                                 !1
         46        DO_ICALL                                                 
         47      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
174.1 ms | 1400 KiB | 17 Q