3v4l.org

run code in 500+ PHP versions simultaneously
<?php $item = []; $item['order_price'] = '$25.80'; $fmt = new NumberFormatter('en', NumberFormatter::CURRENCY); $decimal = $fmt->parseCurrency($item['order_price'], $cur); var_dump($decimal, $cur); $currency = $fmt->formatCurrency($decimal, $cur); var_dump($currency);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XmE3h
function name:  (null)
number of ops:  29
compiled vars:  !0 = $item, !1 = $fmt, !2 = $decimal, !3 = $cur, !4 = $currency
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
    4     1        ASSIGN_DIM                                                   !0, 'order_price'
          2        OP_DATA                                                      '%2425.80'
    6     3        NEW                                                  $7      'NumberFormatter'
          4        SEND_VAL_EX                                                  'en'
          5        FETCH_CLASS_CONSTANT                                 ~8      'NumberFormatter', 'CURRENCY'
          6        SEND_VAL_EX                                                  ~8
          7        DO_FCALL                                          0          
          8        ASSIGN                                                       !1, $7
    8     9        INIT_METHOD_CALL                                             !1, 'parseCurrency'
         10        CHECK_FUNC_ARG                                               
         11        FETCH_DIM_FUNC_ARG                                   $11     !0, 'order_price'
         12        SEND_FUNC_ARG                                                $11
         13        SEND_VAR_EX                                                  !3
         14        DO_FCALL                                          0  $12     
         15        ASSIGN                                                       !2, $12
    9    16        INIT_FCALL                                                   'var_dump'
         17        SEND_VAR                                                     !2
         18        SEND_VAR                                                     !3
         19        DO_ICALL                                                     
   11    20        INIT_METHOD_CALL                                             !1, 'formatCurrency'
         21        SEND_VAR_EX                                                  !2
         22        SEND_VAR_EX                                                  !3
         23        DO_FCALL                                          0  $15     
         24        ASSIGN                                                       !4, $15
   12    25        INIT_FCALL                                                   'var_dump'
         26        SEND_VAR                                                     !4
         27        DO_ICALL                                                     
         28      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
141.22 ms | 1883 KiB | 14 Q