3v4l.org

run code in 300+ PHP versions simultaneously
<?php $collection = [ ['name' => 'b', 'symbol' => '#'], ['name' => '2a', 'symbol' => '$'], ['name' => '1', 'symbol' => '@'], ['name' => 'a', 'symbol' => '%'] ]; usort( $collection, fn($a, $b) => (ctype_alpha($b['name']) <=> ctype_alpha($a['name'])) ?: strnatcmp($a['name'], $b['name']) ); var_export($collection);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BsflO
function name:  (null)
number of ops:  10
compiled vars:  !0 = $collection
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   10     1        INIT_FCALL                                               'usort'
   11     2        SEND_REF                                                 !0
   12     3        DECLARE_LAMBDA_FUNCTION                          ~2      [0]
   15     4        SEND_VAL                                                 ~2
   10     5        DO_ICALL                                                 
   16     6        INIT_FCALL                                               'var_export'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                                 
          9      > 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/BsflO
function name:  {closure}
number of ops:  21
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   13     2        INIT_FCALL                                               'ctype_alpha'
          3        FETCH_DIM_R                                      ~2      !1, 'name'
          4        SEND_VAL                                                 ~2
          5        DO_ICALL                                         $3      
          6        INIT_FCALL                                               'ctype_alpha'
          7        FETCH_DIM_R                                      ~4      !0, 'name'
          8        SEND_VAL                                                 ~4
          9        DO_ICALL                                         $5      
         10        SPACESHIP                                        ~6      $3, $5
         11        JMP_SET                                          ~7      ~6, ->19
   14    12        INIT_FCALL                                               'strnatcmp'
         13        FETCH_DIM_R                                      ~8      !0, 'name'
         14        SEND_VAL                                                 ~8
         15        FETCH_DIM_R                                      ~9      !1, 'name'
         16        SEND_VAL                                                 ~9
         17        DO_ICALL                                         $10     
         18        QM_ASSIGN                                        ~7      $10
         19      > RETURN                                                   ~7
   15    20*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
231.71 ms | 1006 KiB | 17 Q