3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array(array(0), 'first' => array('first'), array(1),array(2), 'second'=>array('second'), array(3), array(4)); uksort($array, function ($ka, $kb) { if (is_int($ka)) { if (!is_int($kb)) { return 1; } return $ka - $kb; } else { if (!is_int($kb)) { return strcmp($ka, $kb); } return -1; } }); print_r($array);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ai3Zs
function name:  (null)
number of ops:  10
compiled vars:  !0 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    4     1        INIT_FCALL                                               'uksort'
          2        SEND_REF                                                 !0
          3        DECLARE_LAMBDA_FUNCTION                          ~2      [0]
   17     4        SEND_VAL                                                 ~2
    4     5        DO_ICALL                                                 
   18     6        INIT_FCALL                                               'print_r'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                                 
          9      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 11
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 8
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 19
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ai3Zs
function name:  {closure}
number of ops:  21
compiled vars:  !0 = $ka, !1 = $kb
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    5     2        TYPE_CHECK                                   16          !0
          3      > JMPZ                                                     ~2, ->11
    6     4    >   TYPE_CHECK                                   16  ~3      !1
          5        BOOL_NOT                                         ~4      ~3
          6      > JMPZ                                                     ~4, ->8
    7     7    > > RETURN                                                   1
    9     8    >   SUB                                              ~5      !0, !1
          9      > RETURN                                                   ~5
    5    10*       JMP                                                      ->20
   12    11    >   TYPE_CHECK                                   16  ~6      !1
         12        BOOL_NOT                                         ~7      ~6
         13      > JMPZ                                                     ~7, ->19
   13    14    >   INIT_FCALL                                               'strcmp'
         15        SEND_VAR                                                 !0
         16        SEND_VAR                                                 !1
         17        DO_ICALL                                         $8      
         18      > RETURN                                                   $8
   15    19    > > RETURN                                                   -1
   17    20*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
138.14 ms | 1001 KiB | 16 Q