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 = (float) 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/SvsKI
function name:  (null)
number of ops:  11
compiled vars:  !0 = $test, !1 = $new
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '1.000.000%2C12'
    8     1        INIT_FCALL                                               'str_replace'
          2        SEND_VAL                                                 <array>
          3        SEND_VAL                                                 <array>
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $3      
          6        CAST                                          5  ~4      $3
          7        ASSIGN                                                   !1, ~4
   12     8        CONCAT                                           ~6      'new%3A+', !1
          9        ECHO                                                     ~6
         10      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.12 ms | 1394 KiB | 15 Q