3v4l.org

run code in 300+ PHP versions simultaneously
<?php const REQUIRED = 1; const OPTIONAL = 2; const IS_ARRAY = 4; $args = [ 'a' => [IS_ARRAY], 'b' => [OPTIONAL], 'c' => [REQUIRED], 'd' => [REQUIRED] ]; uasort( $args, function ($a, $b) { if ($a[0] & IS_ARRAY === IS_ARRAY) { return ($b[0] & IS_ARRAY === IS_ARRAY) ? 0 : -1; } if ($b[0] & IS_ARRAY === IS_ARRAY) { return ($a[0] & IS_ARRAY === IS_ARRAY) ? 0 : 1; } if ($a[0] & OPTIONAL === OPTIONAL) { return ($b[0] & OPTIONAL === OPTIONAL) ? 0 : -1; } if ($b[0] & OPTIONAL === OPTIONAL) { return ($a[0] & OPTIONAL === OPTIONAL) ? 0 : 1; } return 0; } ); var_dump($args);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ecCJD
function name:  (null)
number of ops:  25
compiled vars:  !0 = $args
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CONST                                            'REQUIRED', 1
    4     1        DECLARE_CONST                                            'OPTIONAL', 2
    5     2        DECLARE_CONST                                            'IS_ARRAY', 4
    8     3        FETCH_CONSTANT                                   ~1      'IS_ARRAY'
          4        INIT_ARRAY                                       ~2      ~1
          5        INIT_ARRAY                                       ~3      ~2, 'a'
    9     6        FETCH_CONSTANT                                   ~4      'OPTIONAL'
          7        INIT_ARRAY                                       ~5      ~4
          8        ADD_ARRAY_ELEMENT                                ~3      ~5, 'b'
   10     9        FETCH_CONSTANT                                   ~6      'REQUIRED'
         10        INIT_ARRAY                                       ~7      ~6
         11        ADD_ARRAY_ELEMENT                                ~3      ~7, 'c'
   11    12        FETCH_CONSTANT                                   ~8      'REQUIRED'
         13        INIT_ARRAY                                       ~9      ~8
         14        ADD_ARRAY_ELEMENT                                ~3      ~9, 'd'
    7    15        ASSIGN                                                   !0, ~3
   14    16        INIT_FCALL                                               'uasort'
   15    17        SEND_REF                                                 !0
   16    18        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FecCJD%3A16%240'
   32    19        SEND_VAL                                                 ~11
         20        DO_ICALL                                                 
   35    21        INIT_FCALL                                               'var_dump'
         22        SEND_VAR                                                 !0
         23        DO_ICALL                                                 
         24      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FecCJD%3A16%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 18
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 16
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
2 jumps found. (Code = 43) Position 1 = 24, Position 2 = 34
Branch analysis from position: 24
2 jumps found. (Code = 43) Position 1 = 30, Position 2 = 32
Branch analysis from position: 30
1 jumps found. (Code = 42) Position 1 = 33
Branch analysis from position: 33
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 32
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 34
2 jumps found. (Code = 43) Position 1 = 40, Position 2 = 50
Branch analysis from position: 40
2 jumps found. (Code = 43) Position 1 = 46, Position 2 = 48
Branch analysis from position: 46
1 jumps found. (Code = 42) Position 1 = 49
Branch analysis from position: 49
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 48
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 50
2 jumps found. (Code = 43) Position 1 = 56, Position 2 = 66
Branch analysis from position: 56
2 jumps found. (Code = 43) Position 1 = 62, Position 2 = 64
Branch analysis from position: 62
1 jumps found. (Code = 42) Position 1 = 65
Branch analysis from position: 65
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 64
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 66
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ecCJD
function name:  {closure}
number of ops:  68
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   17     2        FETCH_DIM_R                                      ~2      !0, 0
          3        FETCH_CONSTANT                                   ~3      'IS_ARRAY'
          4        FETCH_CONSTANT                                   ~4      'IS_ARRAY'
          5        IS_IDENTICAL                                     ~5      ~3, ~4
          6        BW_AND                                           ~6      ~2, ~5
          7      > JMPZ                                                     ~6, ->18
   18     8    >   FETCH_DIM_R                                      ~7      !1, 0
          9        FETCH_CONSTANT                                   ~8      'IS_ARRAY'
         10        FETCH_CONSTANT                                   ~9      'IS_ARRAY'
         11        IS_IDENTICAL                                     ~10     ~8, ~9
         12        BW_AND                                           ~11     ~7, ~10
         13      > JMPZ                                                     ~11, ->16
         14    >   QM_ASSIGN                                        ~12     0
         15      > JMP                                                      ->17
         16    >   QM_ASSIGN                                        ~12     -1
         17    > > RETURN                                                   ~12
   20    18    >   FETCH_DIM_R                                      ~13     !1, 0
         19        FETCH_CONSTANT                                   ~14     'IS_ARRAY'
         20        FETCH_CONSTANT                                   ~15     'IS_ARRAY'
         21        IS_IDENTICAL                                     ~16     ~14, ~15
         22        BW_AND                                           ~17     ~13, ~16
         23      > JMPZ                                                     ~17, ->34
   21    24    >   FETCH_DIM_R                                      ~18     !0, 0
         25        FETCH_CONSTANT                                   ~19     'IS_ARRAY'
         26        FETCH_CONSTANT                                   ~20     'IS_ARRAY'
         27        IS_IDENTICAL                                     ~21     ~19, ~20
         28        BW_AND                                           ~22     ~18, ~21
         29      > JMPZ                                                     ~22, ->32
         30    >   QM_ASSIGN                                        ~23     0
         31      > JMP                                                      ->33
         32    >   QM_ASSIGN                                        ~23     1
         33    > > RETURN                                                   ~23
   24    34    >   FETCH_DIM_R                                      ~24     !0, 0
         35        FETCH_CONSTANT                                   ~25     'OPTIONAL'
         36        FETCH_CONSTANT                                   ~26     'OPTIONAL'
         37        IS_IDENTICAL                                     ~27     ~25, ~26
         38        BW_AND                                           ~28     ~24, ~27
         39      > JMPZ                                                     ~28, ->50
   25    40    >   FETCH_DIM_R                                      ~29     !1, 0
         41        FETCH_CONSTANT                                   ~30     'OPTIONAL'
         42        FETCH_CONSTANT                                   ~31     'OPTIONAL'
         43        IS_IDENTICAL                                     ~32     ~30, ~31
         44        BW_AND                                           ~33     ~29, ~32
         45      > JMPZ                                                     ~33, ->48
         46    >   QM_ASSIGN                                        ~34     0
         47      > JMP                                                      ->49
         48    >   QM_ASSIGN                                        ~34     -1
         49    > > RETURN                                                   ~34
   27    50    >   FETCH_DIM_R                                      ~35     !1, 0
         51        FETCH_CONSTANT                                   ~36     'OPTIONAL'
         52        FETCH_CONSTANT                                   ~37     'OPTIONAL'
         53        IS_IDENTICAL                                     ~38     ~36, ~37
         54        BW_AND                                           ~39     ~35, ~38
         55      > JMPZ                                                     ~39, ->66
   28    56    >   FETCH_DIM_R                                      ~40     !0, 0
         57        FETCH_CONSTANT                                   ~41     'OPTIONAL'
         58        FETCH_CONSTANT                                   ~42     'OPTIONAL'
         59        IS_IDENTICAL                                     ~43     ~41, ~42
         60        BW_AND                                           ~44     ~40, ~43
         61      > JMPZ                                                     ~44, ->64
         62    >   QM_ASSIGN                                        ~45     0
         63      > JMP                                                      ->65
         64    >   QM_ASSIGN                                        ~45     1
         65    > > RETURN                                                   ~45
   31    66    > > RETURN                                                   0
   32    67*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FecCJD%3A16%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
179.36 ms | 1404 KiB | 17 Q