3v4l.org

run code in 300+ PHP versions simultaneously
<?php $tests = ['âa', 'Bbbbb', 'Éé', 'iou', 'Δδ']; foreach ($tests as $test) { echo "\n{$test}:"; echo "\n\tPREG: " , preg_match('~^\p{Lu}~u', $test) ? 'upper' : 'lower'; echo "\n\tCTYPE: " , ctype_upper(mb_substr($test, 0, 1)) ? 'upper' : 'lower'; echo "\n\t< a: " , mb_substr($test, 0, 1) < 'a' ? 'upper' : 'lower'; $chr = mb_substr ($test, 0, 1, "UTF-8"); echo "\n\tMB: " , mb_strtoupper($chr, "UTF-8") == $chr ? 'upper' : 'lower'; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 62
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 62
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 15
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
2 jumps found. (Code = 43) Position 1 = 27, Position 2 = 29
Branch analysis from position: 27
1 jumps found. (Code = 42) Position 1 = 30
Branch analysis from position: 30
2 jumps found. (Code = 43) Position 1 = 39, Position 2 = 41
Branch analysis from position: 39
1 jumps found. (Code = 42) Position 1 = 42
Branch analysis from position: 42
2 jumps found. (Code = 43) Position 1 = 57, Position 2 = 59
Branch analysis from position: 57
1 jumps found. (Code = 42) Position 1 = 60
Branch analysis from position: 60
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 59
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 41
2 jumps found. (Code = 43) Position 1 = 57, Position 2 = 59
Branch analysis from position: 57
Branch analysis from position: 59
Branch analysis from position: 29
2 jumps found. (Code = 43) Position 1 = 39, Position 2 = 41
Branch analysis from position: 39
Branch analysis from position: 41
Branch analysis from position: 15
2 jumps found. (Code = 43) Position 1 = 27, Position 2 = 29
Branch analysis from position: 27
Branch analysis from position: 29
Branch analysis from position: 62
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 62
filename:       /in/4eGBV
function name:  (null)
number of ops:  64
compiled vars:  !0 = $tests, !1 = $test, !2 = $chr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    4     1      > FE_RESET_R                                       $4      !0, ->62
          2    > > FE_FETCH_R                                               $4, !1, ->62
    5     3    >   ROPE_INIT                                     3  ~6      '%0A'
          4        ROPE_ADD                                      1  ~6      ~6, !1
          5        ROPE_END                                      2  ~5      ~6, '%3A'
          6        ECHO                                                     ~5
    6     7        ECHO                                                     '%0A%09PREG%3A++'
          8        INIT_FCALL                                               'preg_match'
          9        SEND_VAL                                                 '%7E%5E%5Cp%7BLu%7D%7Eu'
         10        SEND_VAR                                                 !1
         11        DO_ICALL                                         $8      
         12      > JMPZ                                                     $8, ->15
         13    >   QM_ASSIGN                                        ~9      'upper'
         14      > JMP                                                      ->16
         15    >   QM_ASSIGN                                        ~9      'lower'
         16    >   ECHO                                                     ~9
    7    17        ECHO                                                     '%0A%09CTYPE%3A+'
         18        INIT_FCALL                                               'ctype_upper'
         19        INIT_FCALL                                               'mb_substr'
         20        SEND_VAR                                                 !1
         21        SEND_VAL                                                 0
         22        SEND_VAL                                                 1
         23        DO_ICALL                                         $10     
         24        SEND_VAR                                                 $10
         25        DO_ICALL                                         $11     
         26      > JMPZ                                                     $11, ->29
         27    >   QM_ASSIGN                                        ~12     'upper'
         28      > JMP                                                      ->30
         29    >   QM_ASSIGN                                        ~12     'lower'
         30    >   ECHO                                                     ~12
    8    31        ECHO                                                     '%0A%09%3C+a%3A+++'
         32        INIT_FCALL                                               'mb_substr'
         33        SEND_VAR                                                 !1
         34        SEND_VAL                                                 0
         35        SEND_VAL                                                 1
         36        DO_ICALL                                         $13     
         37        IS_SMALLER                                               $13, 'a'
         38      > JMPZ                                                     ~14, ->41
         39    >   QM_ASSIGN                                        ~15     'upper'
         40      > JMP                                                      ->42
         41    >   QM_ASSIGN                                        ~15     'lower'
         42    >   ECHO                                                     ~15
   10    43        INIT_FCALL                                               'mb_substr'
         44        SEND_VAR                                                 !1
         45        SEND_VAL                                                 0
         46        SEND_VAL                                                 1
         47        SEND_VAL                                                 'UTF-8'
         48        DO_ICALL                                         $16     
         49        ASSIGN                                                   !2, $16
   11    50        ECHO                                                     '%0A%09MB%3A++++'
         51        INIT_FCALL                                               'mb_strtoupper'
         52        SEND_VAR                                                 !2
         53        SEND_VAL                                                 'UTF-8'
         54        DO_ICALL                                         $18     
         55        IS_EQUAL                                                 !2, $18
         56      > JMPZ                                                     ~19, ->59
         57    >   QM_ASSIGN                                        ~20     'upper'
         58      > JMP                                                      ->60
         59    >   QM_ASSIGN                                        ~20     'lower'
         60    >   ECHO                                                     ~20
    4    61      > JMP                                                      ->2
         62    >   FE_FREE                                                  $4
   12    63      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.52 ms | 1006 KiB | 17 Q