3v4l.org

run code in 500+ PHP versions simultaneously
<?php $price = "one price $1,234,567.223 and some other price $60"; preg_match_all('/([\d\.,]+)/',$price,$match); Var_dump($match); $formatter = new NumberFormatter('en_US', NumberFormatter::CURRENCY); Var_export($formatter->parseCurrency($price, $curr));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ejmfj
function name:  (null)
number of ops:  23
compiled vars:  !0 = $price, !1 = $match, !2 = $formatter, !3 = $curr
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, 'one+price+%241%2C234%2C567.223+and+some+other+price+%2460'
    5     1        INIT_FCALL                                                   'preg_match_all'
          2        SEND_VAL                                                     '%2F%28%5B%5Cd%5C.%2C%5D%2B%29%2F'
          3        SEND_VAR                                                     !0
          4        SEND_REF                                                     !1
          5        DO_ICALL                                                     
    6     6        INIT_FCALL                                                   'var_dump'
          7        SEND_VAR                                                     !1
          8        DO_ICALL                                                     
    8     9        NEW                                                  $7      'NumberFormatter'
         10        SEND_VAL_EX                                                  'en_US'
         11        FETCH_CLASS_CONSTANT                                 ~8      'NumberFormatter', 'CURRENCY'
         12        SEND_VAL_EX                                                  ~8
         13        DO_FCALL                                          0          
         14        ASSIGN                                                       !2, $7
    9    15        INIT_FCALL                                                   'var_export'
         16        INIT_METHOD_CALL                                             !2, 'parseCurrency'
         17        SEND_VAR_EX                                                  !0
         18        SEND_VAR_EX                                                  !3
         19        DO_FCALL                                          0  $11     
         20        SEND_VAR                                                     $11
         21        DO_ICALL                                                     
         22      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
173.11 ms | 2112 KiB | 16 Q