3v4l.org

run code in 300+ PHP versions simultaneously
<?php $price = 9987536453; $last_digit = (string)$price[-1]; echo $last_digit."<br />\n"; $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/hXr97
function name:  (null)
number of ops:  22
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        CAST                                          6  ~4      ~3
          3        ASSIGN                                                   !1, ~4
    5     4        CONCAT                                           ~6      !1, '%3Cbr+%2F%3E%0A'
          5        ECHO                                                     ~6
    6     6        INIT_FCALL                                               'substr_replace'
          7        SEND_VAR                                                 !0
          8        SEND_VAL                                                 ''
          9        SEND_VAL                                                 -1
         10        SEND_VAL                                                 1
         11        DO_ICALL                                         $7      
         12        ASSIGN                                                   !0, $7
    7    13        INIT_FCALL                                               'chunk_split'
         14        SEND_VAR                                                 !0
         15        SEND_VAL                                                 2
         16        SEND_VAL                                                 '%2C'
         17        DO_ICALL                                         $9      
         18        CONCAT                                           ~10     $9, !1
         19        ASSIGN                                                   !0, ~10
    8    20        ECHO                                                     !0
    9    21      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.6 ms | 1399 KiB | 17 Q