3v4l.org

run code in 300+ PHP versions simultaneously
<?php $var = 1; $arr = array( 0 => array( 'id' => 5, 'NumberAssigned' => 1 ), "n" => array( 'id' => 22, 'NumberAssigned' => 1 ) ); $narr = array_unique(array_column($arr, "NumberAssigned")); If(in_array($var, $narr) && count($narr) == 1){ $var++; }Else{ // They are not all 1 } Echo $var;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 15, Position 2 = 18
Branch analysis from position: 15
2 jumps found. (Code = 43) Position 1 = 19, Position 2 = 21
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
Branch analysis from position: 18
filename:       /in/k08NI
function name:  (null)
number of ops:  23
compiled vars:  !0 = $var, !1 = $arr, !2 = $narr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 1
    4     1        ASSIGN                                                   !1, <array>
   15     2        INIT_FCALL                                               'array_unique'
          3        INIT_FCALL                                               'array_column'
          4        SEND_VAR                                                 !1
          5        SEND_VAL                                                 'NumberAssigned'
          6        DO_ICALL                                         $5      
          7        SEND_VAR                                                 $5
          8        DO_ICALL                                         $6      
          9        ASSIGN                                                   !2, $6
   17    10        INIT_FCALL                                               'in_array'
         11        SEND_VAR                                                 !0
         12        SEND_VAR                                                 !2
         13        DO_ICALL                                         $8      
         14      > JMPZ_EX                                          ~9      $8, ->18
         15    >   COUNT                                            ~10     !2
         16        IS_EQUAL                                         ~11     ~10, 1
         17        BOOL                                             ~9      ~11
         18    > > JMPZ                                                     ~9, ->21
   18    19    >   PRE_INC                                                  !0
   17    20      > JMP                                                      ->21
   23    21    >   ECHO                                                     !0
   24    22      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
268.06 ms | 1007 KiB | 16 Q