3v4l.org

run code in 300+ PHP versions simultaneously
<?php $myArray = array( "apple" => 2, "orange" => 5, "banana" => 3, "kiwi" => 1, ); $specialKey = "banana"; uksort( $myArray, fn($a, $b) => [$a !== $specialKey, $a] <=> [$b !== $specialKey, $b] ); var_export($myArray);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/enteO
function name:  (null)
number of ops:  12
compiled vars:  !0 = $myArray, !1 = $specialKey
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   10     1        ASSIGN                                                   !1, 'banana'
   12     2        INIT_FCALL                                               'uksort'
   13     3        SEND_REF                                                 !0
   14     4        DECLARE_LAMBDA_FUNCTION                          ~4      [0]
          5        BIND_LEXICAL                                             ~4, !1
   15     6        SEND_VAL                                                 ~4
   12     7        DO_ICALL                                                 
   17     8        INIT_FCALL                                               'var_export'
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                                 
         11      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/enteO
function name:  {closure}
number of ops:  12
compiled vars:  !0 = $a, !1 = $b, !2 = $specialKey
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        BIND_STATIC                                              !2
          3        IS_NOT_IDENTICAL                                 ~3      !0, !2
          4        INIT_ARRAY                                       ~4      ~3
          5        ADD_ARRAY_ELEMENT                                ~4      !0
          6        IS_NOT_IDENTICAL                                 ~5      !1, !2
          7        INIT_ARRAY                                       ~6      ~5
          8        ADD_ARRAY_ELEMENT                                ~6      !1
          9        SPACESHIP                                        ~7      ~4, ~6
         10      > RETURN                                                   ~7
   15    11*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.49 ms | 1011 KiB | 15 Q