3v4l.org

run code in 300+ PHP versions simultaneously
<?php $valore = '300000.01'; $numchar = 5; $s = str_replace(".", "", sprintf("%0".$numchar."f", $valore)); echo $s;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/20Hf4
function name:  (null)
number of ops:  16
compiled vars:  !0 = $valore, !1 = $numchar, !2 = $s
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '300000.01'
    4     1        ASSIGN                                                   !1, 5
    6     2        INIT_FCALL                                               'str_replace'
          3        SEND_VAL                                                 '.'
          4        SEND_VAL                                                 ''
          5        INIT_FCALL                                               'sprintf'
          6        CONCAT                                           ~5      '%250', !1
          7        CONCAT                                           ~6      ~5, 'f'
          8        SEND_VAL                                                 ~6
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                         $7      
         11        SEND_VAR                                                 $7
         12        DO_ICALL                                         $8      
         13        ASSIGN                                                   !2, $8
    7    14        ECHO                                                     !2
         15      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.87 ms | 1394 KiB | 17 Q