3v4l.org

run code in 500+ PHP versions simultaneously
<?php $amount = "127,000.00 $"; $amount = explode(" ",$amount); $amount = $amount[0]; $b = str_replace( ',', '', $amount ); if( is_numeric( $b ) ) { $amount = $b; } echo $amount ; echo "<br/>"; $amount = number_format($amount);//127,000 $value = intval(preg_replace('/[^d.]/', '', $amount )); echo $value;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 14
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
filename:       /in/jMZFt
function name:  (null)
number of ops:  26
compiled vars:  !0 = $amount, !1 = $b, !2 = $value
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, '127%2C000.00+%24'
    4     1        INIT_FCALL                                                   'explode'
          2        SEND_VAL                                                     '+'
          3        SEND_VAR                                                     !0
          4        DO_ICALL                                             $4      
          5        ASSIGN                                                       !0, $4
    5     6        FETCH_DIM_R                                          ~6      !0, 0
          7        ASSIGN                                                       !0, ~6
    6     8        FRAMELESS_ICALL_3                str_replace         ~8      '%2C', ''
          9        OP_DATA                                                      !0
         10        ASSIGN                                                       !1, ~8
    7    11        FRAMELESS_ICALL_1                is_numeric          ~10     !1
         12      > JMPZ                                                         ~10, ->14
    8    13    >   ASSIGN                                                       !0, !1
   10    14    >   ECHO                                                         !0
   11    15        ECHO                                                         '%3Cbr%2F%3E'
   12    16        INIT_FCALL                                                   'number_format'
         17        SEND_VAR                                                     !0
         18        DO_ICALL                                             $12     
         19        ASSIGN                                                       !0, $12
   13    20        FRAMELESS_ICALL_3                preg_replace        ~14     '%2F%5B%5Ed.%5D%2F', ''
         21        OP_DATA                                                      !0
         22        CAST                                              4  ~15     ~14
         23        ASSIGN                                                       !2, ~15
   14    24        ECHO                                                         !2
   15    25      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
160.69 ms | 2009 KiB | 15 Q