3v4l.org

run code in 300+ PHP versions simultaneously
<?php $foo = [ 'A Place', 'B Place', 'ZZZ Place', 'Åland Islands', -2, -1, 1, 2, 0, array(), array('test'), 'access_module_a1', 'access_module_a2', ]; //natcasesort($foo); echo "\nNatural order sorting (case-insensitive)\n"; //print_r($foo); echo strnatcasecmp('Åland Islands', '1'); function sortByKeyString($a, $b, $key) { $a_title = (is_array($a) && isset($a[$key])) ? $a[$key] : ''; $b_title = (is_array($b) && isset($b[$key])) ? $b[$key] : ''; strnatcasecmp($a_title, $b_title); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SJcAf
function name:  (null)
number of ops:  8
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   20     1        ECHO                                                     '%0ANatural+order+sorting+%28case-insensitive%29%0A'
   22     2        INIT_FCALL                                               'strnatcasecmp'
          3        SEND_VAL                                                 '%C3%85land+Islands'
          4        SEND_VAL                                                 '1'
          5        DO_ICALL                                         $2      
          6        ECHO                                                     $2
   28     7      > RETURN                                                   1

Function sortbykeystring:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 5, Position 2 = 7
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 11
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
2 jumps found. (Code = 46) Position 1 = 15, Position 2 = 17
Branch analysis from position: 15
2 jumps found. (Code = 43) Position 1 = 18, Position 2 = 21
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
Branch analysis from position: 11
2 jumps found. (Code = 46) Position 1 = 15, Position 2 = 17
Branch analysis from position: 15
Branch analysis from position: 17
Branch analysis from position: 7
filename:       /in/SJcAf
function name:  sortByKeyString
number of ops:  28
compiled vars:  !0 = $a, !1 = $b, !2 = $key, !3 = $a_title, !4 = $b_title
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
   24     3        TYPE_CHECK                                  128  ~5      !0
          4      > JMPZ_EX                                          ~5      ~5, ->7
          5    >   ISSET_ISEMPTY_DIM_OBJ                         0  ~6      !0, !2
          6        BOOL                                             ~5      ~6
          7    > > JMPZ                                                     ~5, ->11
          8    >   FETCH_DIM_R                                      ~7      !0, !2
          9        QM_ASSIGN                                        ~8      ~7
         10      > JMP                                                      ->12
         11    >   QM_ASSIGN                                        ~8      ''
         12    >   ASSIGN                                                   !3, ~8
   25    13        TYPE_CHECK                                  128  ~10     !1
         14      > JMPZ_EX                                          ~10     ~10, ->17
         15    >   ISSET_ISEMPTY_DIM_OBJ                         0  ~11     !1, !2
         16        BOOL                                             ~10     ~11
         17    > > JMPZ                                                     ~10, ->21
         18    >   FETCH_DIM_R                                      ~12     !1, !2
         19        QM_ASSIGN                                        ~13     ~12
         20      > JMP                                                      ->22
         21    >   QM_ASSIGN                                        ~13     ''
         22    >   ASSIGN                                                   !4, ~13
   27    23        INIT_FCALL                                               'strnatcasecmp'
         24        SEND_VAR                                                 !3
         25        SEND_VAR                                                 !4
         26        DO_ICALL                                                 
   28    27      > RETURN                                                   null

End of function sortbykeystring

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.5 ms | 1400 KiB | 15 Q