3v4l.org

run code in 300+ PHP versions simultaneously
<?php function authorform_form_alter_custom_sort($a,$b){ $orderPL = array('A','Ą','B','C','Ć','D','E','Ę','F','G','H','I','J','K','L','Ł','M','N','Ń','O','Ó','P','Q','R','S','Ś','T','U','V','W','X','Y','Z','Ź','Ż', 'a','ą','b','c','ć','d','e','ę','f','g','h','i','j','k','l','ł','m','n','ń','o','ó','p','q','r','s','ś','t','u','v','w','x','y','z','ź','ż'); if ($a == $b) { return 0; } if (mb_substr($a, 0, 1, 'utf-8') == mb_substr($b, 0, 1, 'utf-8')) { return authorform_form_alter_custom_sort(substr($a, 1),substr($b, 1)); } return (array_search($a, $orderPL) < array_search($b, $orderPL)) ? -1 : 1; } echo authorform_form_alter_custom_sort("Olko","Pietraśko");
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ReaWZ
function name:  (null)
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   INIT_FCALL                                               'authorform_form_alter_custom_sort'
          1        SEND_VAL                                                 'Olko'
          2        SEND_VAL                                                 'Pietra%C5%9Bko'
          3        DO_FCALL                                      0  $0      
          4        ECHO                                                     $0
          5      > RETURN                                                   1

Function authorform_form_alter_custom_sort:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 6
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 20, Position 2 = 33
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 33
2 jumps found. (Code = 43) Position 1 = 43, Position 2 = 45
Branch analysis from position: 43
1 jumps found. (Code = 42) Position 1 = 46
Branch analysis from position: 46
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 45
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ReaWZ
function name:  authorform_form_alter_custom_sort
number of ops:  48
compiled vars:  !0 = $a, !1 = $b, !2 = $orderPL
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    4     2        ASSIGN                                                   !2, <array>
    6     3        IS_EQUAL                                                 !0, !1
          4      > JMPZ                                                     ~4, ->6
    7     5    > > RETURN                                                   0
    9     6    >   INIT_FCALL                                               'mb_substr'
          7        SEND_VAR                                                 !0
          8        SEND_VAL                                                 0
          9        SEND_VAL                                                 1
         10        SEND_VAL                                                 'utf-8'
         11        DO_ICALL                                         $5      
         12        INIT_FCALL                                               'mb_substr'
         13        SEND_VAR                                                 !1
         14        SEND_VAL                                                 0
         15        SEND_VAL                                                 1
         16        SEND_VAL                                                 'utf-8'
         17        DO_ICALL                                         $6      
         18        IS_EQUAL                                                 $5, $6
         19      > JMPZ                                                     ~7, ->33
   10    20    >   INIT_FCALL_BY_NAME                                       'authorform_form_alter_custom_sort'
         21        INIT_FCALL                                               'substr'
         22        SEND_VAR                                                 !0
         23        SEND_VAL                                                 1
         24        DO_ICALL                                         $8      
         25        SEND_VAR_NO_REF_EX                                       $8
         26        INIT_FCALL                                               'substr'
         27        SEND_VAR                                                 !1
         28        SEND_VAL                                                 1
         29        DO_ICALL                                         $9      
         30        SEND_VAR_NO_REF_EX                                       $9
         31        DO_FCALL                                      0  $10     
         32      > RETURN                                                   $10
   12    33    >   INIT_FCALL                                               'array_search'
         34        SEND_VAR                                                 !0
         35        SEND_VAR                                                 !2
         36        DO_ICALL                                         $11     
         37        INIT_FCALL                                               'array_search'
         38        SEND_VAR                                                 !1
         39        SEND_VAR                                                 !2
         40        DO_ICALL                                         $12     
         41        IS_SMALLER                                               $11, $12
         42      > JMPZ                                                     ~13, ->45
         43    >   QM_ASSIGN                                        ~14     -1
         44      > JMP                                                      ->46
         45    >   QM_ASSIGN                                        ~14     1
         46    > > RETURN                                                   ~14
   13    47*     > RETURN                                                   null

End of function authorform_form_alter_custom_sort

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
169.84 ms | 1402 KiB | 20 Q