3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a=['apples'=>10,'bananas'=>15,'carrots'=>100,'oranges'=>25]; arsort($a); var_dump($a); uksort($a, function ($a, $b) { return $b == 'bananas' ? 1 : 0; }); var_dump($a);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/m23dM
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%2Fm23dM%3A9%240'
         10        SEND_VAL                                                 ~4
         11        DO_ICALL                                                 
   11    12        INIT_FCALL                                               'var_dump'
         13        SEND_VAR                                                 !0
         14        DO_ICALL                                                 
         15      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2Fm23dM%3A9%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 6
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/m23dM
function name:  {closure}
number of ops:  9
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        IS_EQUAL                                                 !1, 'bananas'
          3      > JMPZ                                                     ~2, ->6
          4    >   QM_ASSIGN                                        ~3      1
          5      > JMP                                                      ->7
          6    >   QM_ASSIGN                                        ~3      0
          7    > > RETURN                                                   ~3
          8*     > RETURN                                                   null

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
169.92 ms | 1396 KiB | 19 Q