3v4l.org

run code in 500+ PHP versions simultaneously
<?php print "No keywords return: "; var_dump(Locale::getKeywords('en')); print "\nNo locale specified use the default, which doesn't usually have keywords. Returns: "; var_dump(Locale::getKeywords('')); print "\nBut it could, so worth mentioning the argument default. Returns: "; Locale::setDefault('sl-Latn-IT-nedis@currency=EUR;collation=PHONEBOOK'); var_dump(Locale::getKeywords('')); print "\nThe INTL_MAX_LOCALE_LEN is: " . INTL_MAX_LOCALE_LEN; $long_locale = 'sl-Latn-IT-nedis@currency=EUR;collation=PHONEBOOK;calendar=islamic-umalqura;numbers=hansfin;foo=lorumipsumsedutperspiciatisundeomnisistenatuserrorsitlorumip'; print "\nSo a string of " . strlen($long_locale) . " returns: "; var_dump(Locale::getKeywords($long_locale)); $longer_locale = 'sl-Latn-IT-nedis@currency=EUR;collation=PHONEBOOK;calendar=islamic-umalqura;numbers=hansfin;foo=lorumipsumsedutperspiciatisundeomnisistenatuserrorsitlorumips'; print "But a string of " . strlen($longer_locale) . " returns: "; var_dump(Locale::getKeywords($longer_locale)); $keyword = 'lorumipsumsedutperspiciatisundeomnisistenatuserrorsitlorumipslorumipsumsedutperspiciatisundeomnisistenatuserrorsit'; print "\nJust one keyword value with a max length longer than 100? (" . strlen($keyword) . ") Returns: "; $keyword_locale = 'sl-Latn-IT-nedis@cfoo=' . $keyword; var_dump(Locale::getKeywords($keyword_locale)); print "\nJust one keyword key with a max length longer than 100? (" . strlen($keyword) . ") Returns: "; $keyword_locale = 'sl-Latn-IT-nedis@' . $keyword . '=foo'; var_dump(Locale::getKeywords($keyword_locale));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/nhDZW
function name:  (null)
number of ops:  76
compiled vars:  !0 = $long_locale, !1 = $longer_locale, !2 = $keyword, !3 = $keyword_locale
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ECHO                                                         'No+keywords+return%3A+'
    4     1        INIT_FCALL                                                   'var_dump'
          2        INIT_STATIC_METHOD_CALL                                      'Locale', 'getKeywords'
          3        SEND_VAL_EX                                                  'en'
          4        DO_FCALL                                          0  $4      
          5        SEND_VAR                                                     $4
          6        DO_ICALL                                                     
    5     7        ECHO                                                         '%0ANo+locale+specified+use+the+default%2C+which+doesn%27t+usually+have+keywords.+Returns%3A+'
    6     8        INIT_FCALL                                                   'var_dump'
          9        INIT_STATIC_METHOD_CALL                                      'Locale', 'getKeywords'
         10        SEND_VAL_EX                                                  ''
         11        DO_FCALL                                          0  $6      
         12        SEND_VAR                                                     $6
         13        DO_ICALL                                                     
    7    14        ECHO                                                         '%0ABut+it+could%2C+so+worth+mentioning+the+argument+default.+Returns%3A+'
    8    15        INIT_STATIC_METHOD_CALL                                      'Locale', 'setDefault'
         16        SEND_VAL_EX                                                  'sl-Latn-IT-nedis%40currency%3DEUR%3Bcollation%3DPHONEBOOK'
         17        DO_FCALL                                          0          
    9    18        INIT_FCALL                                                   'var_dump'
         19        INIT_STATIC_METHOD_CALL                                      'Locale', 'getKeywords'
         20        SEND_VAL_EX                                                  ''
         21        DO_FCALL                                          0  $9      
         22        SEND_VAR                                                     $9
         23        DO_ICALL                                                     
   10    24        FETCH_CONSTANT                                       ~11     'INTL_MAX_LOCALE_LEN'
         25        CONCAT                                               ~12     '%0AThe+INTL_MAX_LOCALE_LEN+is%3A+', ~11
         26        ECHO                                                         ~12
   11    27        ASSIGN                                                       !0, 'sl-Latn-IT-nedis%40currency%3DEUR%3Bcollation%3DPHONEBOOK%3Bcalendar%3Dislamic-umalqura%3Bnumbers%3Dhansfin%3Bfoo%3Dlorumipsumsedutperspiciatisundeomnisistenatuserrorsitlorumip'
   12    28        STRLEN                                               ~14     !0
         29        CONCAT                                               ~15     '%0ASo+a+string+of+', ~14
         30        CONCAT                                               ~16     ~15, '+returns%3A+'
         31        ECHO                                                         ~16
   13    32        INIT_FCALL                                                   'var_dump'
         33        INIT_STATIC_METHOD_CALL                                      'Locale', 'getKeywords'
         34        SEND_VAR_EX                                                  !0
         35        DO_FCALL                                          0  $17     
         36        SEND_VAR                                                     $17
         37        DO_ICALL                                                     
   14    38        ASSIGN                                                       !1, 'sl-Latn-IT-nedis%40currency%3DEUR%3Bcollation%3DPHONEBOOK%3Bcalendar%3Dislamic-umalqura%3Bnumbers%3Dhansfin%3Bfoo%3Dlorumipsumsedutperspiciatisundeomnisistenatuserrorsitlorumips'
   15    39        STRLEN                                               ~20     !1
         40        CONCAT                                               ~21     'But+a+string+of+', ~20
         41        CONCAT                                               ~22     ~21, '+returns%3A+'
         42        ECHO                                                         ~22
   16    43        INIT_FCALL                                                   'var_dump'
         44        INIT_STATIC_METHOD_CALL                                      'Locale', 'getKeywords'
         45        SEND_VAR_EX                                                  !1
         46        DO_FCALL                                          0  $23     
         47        SEND_VAR                                                     $23
         48        DO_ICALL                                                     
   17    49        ASSIGN                                                       !2, 'lorumipsumsedutperspiciatisundeomnisistenatuserrorsitlorumipslorumipsumsedutperspiciatisundeomnisistenatuserrorsit'
   18    50        STRLEN                                               ~26     !2
         51        CONCAT                                               ~27     '%0AJust+one+keyword+value+with+a+max+length+longer+than+100%3F+%28', ~26
         52        CONCAT                                               ~28     ~27, '%29+Returns%3A+'
         53        ECHO                                                         ~28
   19    54        CONCAT                                               ~29     'sl-Latn-IT-nedis%40cfoo%3D', !2
         55        ASSIGN                                                       !3, ~29
   20    56        INIT_FCALL                                                   'var_dump'
         57        INIT_STATIC_METHOD_CALL                                      'Locale', 'getKeywords'
         58        SEND_VAR_EX                                                  !3
         59        DO_FCALL                                          0  $31     
         60        SEND_VAR                                                     $31
         61        DO_ICALL                                                     
   21    62        STRLEN                                               ~33     !2
         63        CONCAT                                               ~34     '%0AJust+one+keyword+key+with+a+max+length+longer+than+100%3F+%28', ~33
         64        CONCAT                                               ~35     ~34, '%29+Returns%3A+'
         65        ECHO                                                         ~35
   22    66        CONCAT                                               ~36     'sl-Latn-IT-nedis%40', !2
         67        CONCAT                                               ~37     ~36, '%3Dfoo'
         68        ASSIGN                                                       !3, ~37
   23    69        INIT_FCALL                                                   'var_dump'
         70        INIT_STATIC_METHOD_CALL                                      'Locale', 'getKeywords'
         71        SEND_VAR_EX                                                  !3
         72        DO_FCALL                                          0  $39     
         73        SEND_VAR                                                     $39
         74        DO_ICALL                                                     
         75      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
180.06 ms | 3782 KiB | 14 Q