3v4l.org

run code in 500+ 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 = 59
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 59
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 12
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
2 jumps found. (Code = 43) Position 1 = 24, Position 2 = 26
Branch analysis from position: 24
1 jumps found. (Code = 42) Position 1 = 27
Branch analysis from position: 27
2 jumps found. (Code = 43) Position 1 = 36, Position 2 = 38
Branch analysis from position: 36
1 jumps found. (Code = 42) Position 1 = 39
Branch analysis from position: 39
2 jumps found. (Code = 43) Position 1 = 54, Position 2 = 56
Branch analysis from position: 54
1 jumps found. (Code = 42) Position 1 = 57
Branch analysis from position: 57
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 56
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 38
2 jumps found. (Code = 43) Position 1 = 54, Position 2 = 56
Branch analysis from position: 54
Branch analysis from position: 56
Branch analysis from position: 26
2 jumps found. (Code = 43) Position 1 = 36, Position 2 = 38
Branch analysis from position: 36
Branch analysis from position: 38
Branch analysis from position: 12
2 jumps found. (Code = 43) Position 1 = 24, Position 2 = 26
Branch analysis from position: 24
Branch analysis from position: 26
Branch analysis from position: 59
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 59
filename:       /in/4eGBV
function name:  (null)
number of ops:  61
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, ->59
          2    > > FE_FETCH_R                                                   $4, !1, ->59
    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        FRAMELESS_ICALL_2                preg_match          ~8      '%7E%5E%5Cp%7BLu%7D%7Eu', !1
          9      > JMPZ                                                         ~8, ->12
         10    >   QM_ASSIGN                                            ~9      'upper'
         11      > JMP                                                          ->13
         12    >   QM_ASSIGN                                            ~9      'lower'
         13    >   ECHO                                                         ~9
    7    14        ECHO                                                         '%0A%09CTYPE%3A+'
         15        INIT_FCALL                                                   'ctype_upper'
         16        INIT_FCALL                                                   'mb_substr'
         17        SEND_VAR                                                     !1
         18        SEND_VAL                                                     0
         19        SEND_VAL                                                     1
         20        DO_ICALL                                             $10     
         21        SEND_VAR                                                     $10
         22        DO_ICALL                                             $11     
         23      > JMPZ                                                         $11, ->26
         24    >   QM_ASSIGN                                            ~12     'upper'
         25      > JMP                                                          ->27
         26    >   QM_ASSIGN                                            ~12     'lower'
         27    >   ECHO                                                         ~12
    8    28        ECHO                                                         '%0A%09%3C+a%3A+++'
         29        INIT_FCALL                                                   'mb_substr'
         30        SEND_VAR                                                     !1
         31        SEND_VAL                                                     0
         32        SEND_VAL                                                     1
         33        DO_ICALL                                             $13     
         34        IS_SMALLER                                                   $13, 'a'
         35      > JMPZ                                                         ~14, ->38
         36    >   QM_ASSIGN                                            ~15     'upper'
         37      > JMP                                                          ->39
         38    >   QM_ASSIGN                                            ~15     'lower'
         39    >   ECHO                                                         ~15
   10    40        INIT_FCALL                                                   'mb_substr'
         41        SEND_VAR                                                     !1
         42        SEND_VAL                                                     0
         43        SEND_VAL                                                     1
         44        SEND_VAL                                                     'UTF-8'
         45        DO_ICALL                                             $16     
         46        ASSIGN                                                       !2, $16
   11    47        ECHO                                                         '%0A%09MB%3A++++'
         48        INIT_FCALL                                                   'mb_strtoupper'
         49        SEND_VAR                                                     !2
         50        SEND_VAL                                                     'UTF-8'
         51        DO_ICALL                                             $18     
         52        IS_EQUAL                                                     !2, $18
         53      > JMPZ                                                         ~19, ->56
         54    >   QM_ASSIGN                                            ~20     'upper'
         55      > JMP                                                          ->57
         56    >   QM_ASSIGN                                            ~20     'lower'
         57    >   ECHO                                                         ~20
    4    58      > JMP                                                          ->2
         59    >   FE_FREE                                                      $4
   12    60      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
371.55 ms | 2395 KiB | 18 Q