3v4l.org

run code in 300+ PHP versions simultaneously
<?php $test = '1.000.000,12'; $old = str_replace('.', '', $test); $old = (float) str_replace(',', '.', $old); //$new = str_replace(array('.', ','), array('', '.'), $test); echo 'old: ' . $old; //echo '<br>'; //echo 'new: ' . $new;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qIMJM
function name:  (null)
number of ops:  17
compiled vars:  !0 = $test, !1 = $old
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '1.000.000%2C12'
    5     1        INIT_FCALL                                               'str_replace'
          2        SEND_VAL                                                 '.'
          3        SEND_VAL                                                 ''
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $3      
          6        ASSIGN                                                   !1, $3
    6     7        INIT_FCALL                                               'str_replace'
          8        SEND_VAL                                                 '%2C'
          9        SEND_VAL                                                 '.'
         10        SEND_VAR                                                 !1
         11        DO_ICALL                                         $5      
         12        CAST                                          5  ~6      $5
         13        ASSIGN                                                   !1, ~6
   10    14        CONCAT                                           ~8      'old%3A+', !1
         15        ECHO                                                     ~8
   12    16      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.48 ms | 1394 KiB | 15 Q