3v4l.org

run code in 300+ PHP versions simultaneously
<?php $formattedMoney = '-$1000'; $parser = new \NumberFormatter('sdfsdf', \NumberFormatter::CURRENCY); $parser->setAttribute(\NumberFormatter::FRACTION_DIGITS, 2); $parser->setAttribute(\NumberFormatter::NEGATIVE_PREFIX, '-'); $decimal = $parser->parseCurrency($formattedMoney, $currency); var_dump($decimal); var_dump($currency); var_dump($formatter->getErrorMessage());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Gh9Cr
function name:  (null)
number of ops:  34
compiled vars:  !0 = $formattedMoney, !1 = $parser, !2 = $decimal, !3 = $currency, !4 = $formatter
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '-%241000'
    5     1        NEW                                              $6      'NumberFormatter'
          2        SEND_VAL_EX                                              'sdfsdf'
          3        FETCH_CLASS_CONSTANT                             ~7      'NumberFormatter', 'CURRENCY'
          4        SEND_VAL_EX                                              ~7
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !1, $6
    6     7        INIT_METHOD_CALL                                         !1, 'setAttribute'
          8        FETCH_CLASS_CONSTANT                             ~10     'NumberFormatter', 'FRACTION_DIGITS'
          9        SEND_VAL_EX                                              ~10
         10        SEND_VAL_EX                                              2
         11        DO_FCALL                                      0          
    7    12        INIT_METHOD_CALL                                         !1, 'setAttribute'
         13        FETCH_CLASS_CONSTANT                             ~12     'NumberFormatter', 'NEGATIVE_PREFIX'
         14        SEND_VAL_EX                                              ~12
         15        SEND_VAL_EX                                              '-'
         16        DO_FCALL                                      0          
    8    17        INIT_METHOD_CALL                                         !1, 'parseCurrency'
         18        SEND_VAR_EX                                              !0
         19        SEND_VAR_EX                                              !3
         20        DO_FCALL                                      0  $14     
         21        ASSIGN                                                   !2, $14
    9    22        INIT_FCALL                                               'var_dump'
         23        SEND_VAR                                                 !2
         24        DO_ICALL                                                 
   10    25        INIT_FCALL                                               'var_dump'
         26        SEND_VAR                                                 !3
         27        DO_ICALL                                                 
   11    28        INIT_FCALL                                               'var_dump'
         29        INIT_METHOD_CALL                                         !4, 'getErrorMessage'
         30        DO_FCALL                                      0  $18     
         31        SEND_VAR                                                 $18
         32        DO_ICALL                                                 
         33      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.43 ms | 1388 KiB | 15 Q