3v4l.org

run code in 300+ PHP versions simultaneously
<?php $number = '1,233,332.34'; if ($separator == 'comma') { $number = str_replace(',', '', $number); } echo number_format($number, 2, ',','.');
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 9
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
filename:       /in/YN6SB
function name:  (null)
number of ops:  17
compiled vars:  !0 = $number, !1 = $separator
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '1%2C233%2C332.34'
    3     1        IS_EQUAL                                                 !1, 'comma'
          2      > JMPZ                                                     ~3, ->9
    4     3    >   INIT_FCALL                                               'str_replace'
          4        SEND_VAL                                                 '%2C'
          5        SEND_VAL                                                 ''
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                         $4      
          8        ASSIGN                                                   !0, $4
    6     9    >   INIT_FCALL                                               'number_format'
         10        SEND_VAR                                                 !0
         11        SEND_VAL                                                 2
         12        SEND_VAL                                                 '%2C'
         13        SEND_VAL                                                 '.'
         14        DO_ICALL                                         $6      
         15        ECHO                                                     $6
         16      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.62 ms | 1394 KiB | 17 Q