3v4l.org

run code in 300+ PHP versions simultaneously
<?php $number = '01,234.50789'; $trunc = preg_replace( '/^.*?[0]*([\d\,]+)(([\.][\d]{0,2})([\d]*))?.*?$/', '$1$3', $number ); echo $trunc;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Jh6KV
function name:  (null)
number of ops:  9
compiled vars:  !0 = $number, !1 = $trunc
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '01%2C234.50789'
    3     1        INIT_FCALL                                               'preg_replace'
    4     2        SEND_VAL                                                 '%2F%5E.%2A%3F%5B0%5D%2A%28%5B%5Cd%5C%2C%5D%2B%29%28%28%5B%5C.%5D%5B%5Cd%5D%7B0%2C2%7D%29%28%5B%5Cd%5D%2A%29%29%3F.%2A%3F%24%2F'
    5     3        SEND_VAL                                                 '%241%243'
    6     4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $3      
    3     6        ASSIGN                                                   !1, $3
    8     7        ECHO                                                     !1
          8      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.73 ms | 1394 KiB | 15 Q