3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a=['apples'=>10,'bananas'=>15,'carrots'=>100,'oranges'=>25,'tomatoes'=>5]; arsort($a); var_dump($a); uksort($a, function ($a, $b) { if ($a == 'bananas' || $a == 'tomatoes') return 0; return ($b == 'bananas' || $b == 'tomatoes') ? 1 : 0; }); var_dump($a);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fug82
function name:  (null)
number of ops:  16
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1        INIT_FCALL                                               'arsort'
          2        SEND_REF                                                 !0
          3        DO_ICALL                                                 
    7     4        INIT_FCALL                                               'var_dump'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                                 
    9     7        INIT_FCALL                                               'uksort'
          8        SEND_REF                                                 !0
          9        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Ffug82%3A9%240'
   12    10        SEND_VAL                                                 ~4
         11        DO_ICALL                                                 
   14    12        INIT_FCALL                                               'var_dump'
         13        SEND_VAR                                                 !0
         14        DO_ICALL                                                 
         15      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2Ffug82%3A9%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 4, Position 2 = 6
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
2 jumps found. (Code = 47) Position 1 = 10, Position 2 = 12
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 15
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
Branch analysis from position: 6
filename:       /in/fug82
function name:  {closure}
number of ops:  18
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   10     2        IS_EQUAL                                         ~2      !0, 'bananas'
          3      > JMPNZ_EX                                         ~2      ~2, ->6
          4    >   IS_EQUAL                                         ~3      !0, 'tomatoes'
          5        BOOL                                             ~2      ~3
          6    > > JMPZ                                                     ~2, ->8
          7    > > RETURN                                                   0
   11     8    >   IS_EQUAL                                         ~4      !1, 'bananas'
          9      > JMPNZ_EX                                         ~4      ~4, ->12
         10    >   IS_EQUAL                                         ~5      !1, 'tomatoes'
         11        BOOL                                             ~4      ~5
         12    > > JMPZ                                                     ~4, ->15
         13    >   QM_ASSIGN                                        ~6      1
         14      > JMP                                                      ->16
         15    >   QM_ASSIGN                                        ~6      0
         16    > > RETURN                                                   ~6
   12    17*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2Ffug82%3A9%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
126.91 ms | 1405 KiB | 19 Q