3v4l.org

run code in 300+ PHP versions simultaneously
<?php $price = 9987536453; $last_digit = $price[-1]; $price = substr_replace($price, "", -1, 1); $price = chunk_split($price, 2, ",").$last_digit; echo $price;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Vd3sc
function name:  (null)
number of ops:  19
compiled vars:  !0 = $price, !1 = $last_digit
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 9987536453
    4     1        FETCH_DIM_R                                      ~3      !0, -1
          2        ASSIGN                                                   !1, ~3
    5     3        INIT_FCALL                                               'substr_replace'
          4        SEND_VAR                                                 !0
          5        SEND_VAL                                                 ''
          6        SEND_VAL                                                 -1
          7        SEND_VAL                                                 1
          8        DO_ICALL                                         $5      
          9        ASSIGN                                                   !0, $5
    6    10        INIT_FCALL                                               'chunk_split'
         11        SEND_VAR                                                 !0
         12        SEND_VAL                                                 2
         13        SEND_VAL                                                 '%2C'
         14        DO_ICALL                                         $7      
         15        CONCAT                                           ~8      $7, !1
         16        ASSIGN                                                   !0, ~8
    7    17        ECHO                                                     !0
    8    18      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
176.36 ms | 1394 KiB | 17 Q