3v4l.org

run code in 300+ PHP versions simultaneously
<?php $locales = array( 'en_US', 'en_GB', 'es_AR', 'es_ES', 'fr_FR', 'de_DE', 'he_IL', ); $styles = array( NumberFormatter::DECIMAL, NumberFormatter::CURRENCY, ); foreach ($locales as $locale) { foreach ($styles as $style) { echo "$locale -- $style\n"; $formatter = new NumberFormatter($locale, $style); var_dump($formatter->format(100)); var_dump($formatter->format(100.00)); var_dump($formatter->format('100')); var_dump($formatter->format('not a number')); var_dump($formatter->format(true)); var_dump($formatter->format(false)); var_dump($formatter->format(array())); var_dump($formatter->format(array(5))); } } $formatter = new NumberFormatter('en_GB', NumberFormatter::PATTERN_DECIMAL); var_dump($formatter->format('123456'));
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 71
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 71
Branch analysis from position: 8
2 jumps found. (Code = 77) Position 1 = 9, Position 2 = 69
Branch analysis from position: 9
2 jumps found. (Code = 78) Position 1 = 10, Position 2 = 69
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 69
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 69
Branch analysis from position: 71
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 71
filename:       /in/8Aoeb
function name:  (null)
number of ops:  85
compiled vars:  !0 = $locales, !1 = $styles, !2 = $locale, !3 = $style, !4 = $formatter
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   14     1        FETCH_CLASS_CONSTANT                             ~6      'NumberFormatter', 'DECIMAL'
          2        INIT_ARRAY                                       ~7      ~6
   15     3        FETCH_CLASS_CONSTANT                             ~8      'NumberFormatter', 'CURRENCY'
          4        ADD_ARRAY_ELEMENT                                ~7      ~8
   13     5        ASSIGN                                                   !1, ~7
   18     6      > FE_RESET_R                                       $10     !0, ->71
          7    > > FE_FETCH_R                                               $10, !2, ->71
   19     8    > > FE_RESET_R                                       $11     !1, ->69
          9    > > FE_FETCH_R                                               $11, !3, ->69
   20    10    >   ROPE_INIT                                     4  ~13     !2
         11        ROPE_ADD                                      1  ~13     ~13, '+--+'
         12        ROPE_ADD                                      2  ~13     ~13, !3
         13        ROPE_END                                      3  ~12     ~13, '%0A'
         14        ECHO                                                     ~12
   21    15        NEW                                              $15     'NumberFormatter'
         16        SEND_VAR_EX                                              !2
         17        SEND_VAR_EX                                              !3
         18        DO_FCALL                                      0          
         19        ASSIGN                                                   !4, $15
   22    20        INIT_FCALL                                               'var_dump'
         21        INIT_METHOD_CALL                                         !4, 'format'
         22        SEND_VAL_EX                                              100
         23        DO_FCALL                                      0  $18     
         24        SEND_VAR                                                 $18
         25        DO_ICALL                                                 
   23    26        INIT_FCALL                                               'var_dump'
         27        INIT_METHOD_CALL                                         !4, 'format'
         28        SEND_VAL_EX                                              100
         29        DO_FCALL                                      0  $20     
         30        SEND_VAR                                                 $20
         31        DO_ICALL                                                 
   24    32        INIT_FCALL                                               'var_dump'
         33        INIT_METHOD_CALL                                         !4, 'format'
         34        SEND_VAL_EX                                              '100'
         35        DO_FCALL                                      0  $22     
         36        SEND_VAR                                                 $22
         37        DO_ICALL                                                 
   25    38        INIT_FCALL                                               'var_dump'
         39        INIT_METHOD_CALL                                         !4, 'format'
         40        SEND_VAL_EX                                              'not+a+number'
         41        DO_FCALL                                      0  $24     
         42        SEND_VAR                                                 $24
         43        DO_ICALL                                                 
   26    44        INIT_FCALL                                               'var_dump'
         45        INIT_METHOD_CALL                                         !4, 'format'
         46        SEND_VAL_EX                                              <true>
         47        DO_FCALL                                      0  $26     
         48        SEND_VAR                                                 $26
         49        DO_ICALL                                                 
   27    50        INIT_FCALL                                               'var_dump'
         51        INIT_METHOD_CALL                                         !4, 'format'
         52        SEND_VAL_EX                                              <false>
         53        DO_FCALL                                      0  $28     
         54        SEND_VAR                                                 $28
         55        DO_ICALL                                                 
   28    56        INIT_FCALL                                               'var_dump'
         57        INIT_METHOD_CALL                                         !4, 'format'
         58        SEND_VAL_EX                                              <array>
         59        DO_FCALL                                      0  $30     
         60        SEND_VAR                                                 $30
         61        DO_ICALL                                                 
   29    62        INIT_FCALL                                               'var_dump'
         63        INIT_METHOD_CALL                                         !4, 'format'
         64        SEND_VAL_EX                                              <array>
         65        DO_FCALL                                      0  $32     
         66        SEND_VAR                                                 $32
         67        DO_ICALL                                                 
   19    68      > JMP                                                      ->9
         69    >   FE_FREE                                                  $11
   18    70      > JMP                                                      ->7
         71    >   FE_FREE                                                  $10
   33    72        NEW                                              $34     'NumberFormatter'
         73        SEND_VAL_EX                                              'en_GB'
         74        FETCH_CLASS_CONSTANT                             ~35     'NumberFormatter', 'PATTERN_DECIMAL'
         75        SEND_VAL_EX                                              ~35
         76        DO_FCALL                                      0          
         77        ASSIGN                                                   !4, $34
   34    78        INIT_FCALL                                               'var_dump'
         79        INIT_METHOD_CALL                                         !4, 'format'
         80        SEND_VAL_EX                                              '123456'
         81        DO_FCALL                                      0  $38     
         82        SEND_VAR                                                 $38
         83        DO_ICALL                                                 
         84      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.62 ms | 1404 KiB | 15 Q