3v4l.org

run code in 300+ PHP versions simultaneously
<?php $tests = [ '1,000.00', '1,000.000', '1.000,00', '1.000,000', '1.00', '1.000', '1,00', '1,000', ]; var_export( preg_replace( ['/[.,](?=\d*[.,])/', '/,/'], ['', '.'], $tests ) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0jk0F
function name:  (null)
number of ops:  10
compiled vars:  !0 = $tests
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
   13     1        INIT_FCALL                                               'var_export'
   14     2        INIT_FCALL                                               'preg_replace'
   15     3        SEND_VAL                                                 <array>
   16     4        SEND_VAL                                                 <array>
   17     5        SEND_VAR                                                 !0
   14     6        DO_ICALL                                         $2      
   17     7        SEND_VAR                                                 $2
   13     8        DO_ICALL                                                 
   19     9      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
136.95 ms | 997 KiB | 15 Q