3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = [456, 8, 1, -9, 'string', true, 0, -65, -162]; usort($arr, function ($a, $b) { if (is_integer($a) && !is_integer($b)) return -1; elseif (!is_integer($a) && is_integer($b)) return 1; else return $b <=> $a; }); var_dump($arr);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HKuqc
function name:  (null)
number of ops:  10
compiled vars:  !0 = $arr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1        INIT_FCALL                                               'usort'
          2        SEND_REF                                                 !0
          3        DECLARE_LAMBDA_FUNCTION                          ~2      [0]
    9     4        SEND_VAL                                                 ~2
    5     5        DO_ICALL                                                 
   10     6        INIT_FCALL                                               'var_dump'
          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 = 46) Position 1 = 4, Position 2 = 7
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 10
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
2 jumps found. (Code = 46) Position 1 = 13, Position 2 = 15
Branch analysis from position: 13
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 18
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
Branch analysis from position: 7
filename:       /in/HKuqc
function name:  {closure}
number of ops:  21
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    6     2        TYPE_CHECK                                   16  ~2      !0
          3      > JMPZ_EX                                          ~2      ~2, ->7
          4    >   TYPE_CHECK                                   16  ~3      !1
          5        BOOL_NOT                                         ~4      ~3
          6        BOOL                                             ~2      ~4
          7    > > JMPZ                                                     ~2, ->10
          8    > > RETURN                                                   -1
          9*       JMP                                                      ->20
    7    10    >   TYPE_CHECK                                   16  ~5      !0
         11        BOOL_NOT                                         ~6      ~5
         12      > JMPZ_EX                                          ~6      ~6, ->15
         13    >   TYPE_CHECK                                   16  ~7      !1
         14        BOOL                                             ~6      ~7
         15    > > JMPZ                                                     ~6, ->18
         16    > > RETURN                                                   1
         17*       JMP                                                      ->20
    8    18    >   SPACESHIP                                        ~8      !1, !0
         19      > RETURN                                                   ~8
    9    20*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.71 ms | 1012 KiB | 15 Q