3v4l.org

run code in 500+ PHP versions simultaneously
<?php foreach (['C', 'tr_TR.UTF-8'] as $locale) { if (setlocale(LC_CTYPE, $locale) === false) { throw new RuntimeException("Locale unavailable: $locale"); } $values = ['I', 'h']; sort($values, SORT_STRING | SORT_FLAG_CASE); $keys = ['I' => 0, 'h' => 0]; ksort($keys, SORT_STRING | SORT_FLAG_CASE); echo $locale, "\n"; echo ' stripos: ', var_export(stripos('I', 'i'), true), "\n"; echo ' strncasecmp: ', strncasecmp('I', 'i', 1), "\n"; echo ' substr_compare: ', substr_compare('I', 'i', 0, 1, true), "\n"; echo ' sort: ', implode(',', $values), "\n"; echo ' ksort: ', implode(',', array_keys($keys)), "\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 1, Position 2 = 67
Branch analysis from position: 1
2 jumps found. (Code = 78) Position 1 = 2, Position 2 = 67
Branch analysis from position: 2
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 14
Branch analysis from position: 8
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 1
Branch analysis from position: 1
Branch analysis from position: 67
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 67
filename:       /in/8A33E
function name:  (null)
number of ops:  69
compiled vars:  !0 = $locale, !1 = $values, !2 = $keys
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E > > FE_RESET_R                                           $3      <array>, ->67
          1    > > FE_FETCH_R                                                   $3, !0, ->67
    4     2    >   INIT_FCALL                                                   'setlocale'
          3        SEND_VAL                                                     0
          4        SEND_VAR                                                     !0
          5        DO_ICALL                                             $4      
          6        TYPE_CHECK                                        4          $4
          7      > JMPZ                                                         ~5, ->14
    5     8    >   NEW                                                  $6      'RuntimeException'
          9        NOP                                                          
         10        FAST_CONCAT                                          ~7      'Locale+unavailable%3A+', !0
         11        SEND_VAL_EX                                                  ~7
         12        DO_FCALL                                          0          
         13      > THROW                                             0          $6
    8    14    >   ASSIGN                                                       !1, <array>
    9    15        INIT_FCALL                                                   'sort'
         16        SEND_REF                                                     !1
         17        SEND_VAL                                                     10
         18        DO_ICALL                                                     
   10    19        ASSIGN                                                       !2, <array>
   11    20        INIT_FCALL                                                   'ksort'
         21        SEND_REF                                                     !2
         22        SEND_VAL                                                     10
         23        DO_ICALL                                                     
   13    24        ECHO                                                         !0
         25        ECHO                                                         '%0A'
   14    26        ECHO                                                         '++stripos%3A++++++++'
         27        INIT_FCALL                                                   'var_export'
         28        INIT_FCALL                                                   'stripos'
         29        SEND_VAL                                                     'I'
         30        SEND_VAL                                                     'i'
         31        DO_ICALL                                             $13     
         32        SEND_VAR                                                     $13
         33        SEND_VAL                                                     <true>
         34        DO_ICALL                                             $14     
         35        ECHO                                                         $14
         36        ECHO                                                         '%0A'
   15    37        ECHO                                                         '++strncasecmp%3A++++'
         38        INIT_FCALL                                                   'strncasecmp'
         39        SEND_VAL                                                     'I'
         40        SEND_VAL                                                     'i'
         41        SEND_VAL                                                     1
         42        DO_ICALL                                             $15     
         43        ECHO                                                         $15
         44        ECHO                                                         '%0A'
   16    45        ECHO                                                         '++substr_compare%3A+'
         46        INIT_FCALL                                                   'substr_compare'
         47        SEND_VAL                                                     'I'
         48        SEND_VAL                                                     'i'
         49        SEND_VAL                                                     0
         50        SEND_VAL                                                     1
         51        SEND_VAL                                                     <true>
         52        DO_ICALL                                             $16     
         53        ECHO                                                         $16
         54        ECHO                                                         '%0A'
   17    55        ECHO                                                         '++sort%3A+++++++++++'
         56        FRAMELESS_ICALL_2                implode             ~17     '%2C', !1
         57        ECHO                                                         ~17
         58        ECHO                                                         '%0A'
   18    59        ECHO                                                         '++ksort%3A++++++++++'
         60        INIT_FCALL                                                   'array_keys'
         61        SEND_VAR                                                     !2
         62        DO_ICALL                                             $18     
         63        FRAMELESS_ICALL_2                implode             ~19     '%2C', $18
         64        ECHO                                                         ~19
         65        ECHO                                                         '%0A'
    3    66      > JMP                                                          ->1
         67    >   FE_FREE                                                      $3
   19    68      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
132.65 ms | 491 KiB | 15 Q