3v4l.org

run code in 300+ PHP versions simultaneously
<?php $price = 9987536453; $last_digit = substr($price, -1, 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/XM0sj
function name:  (null)
number of ops:  25
compiled vars:  !0 = $price, !1 = $last_digit
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 9987536453
    4     1        INIT_FCALL                                               'substr'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 -1
          4        SEND_VAL                                                 1
          5        DO_ICALL                                         $3      
          6        ASSIGN                                                   !1, $3
    5     7        CONCAT                                           ~5      !1, '%3Cbr+%2F%3E%0A'
          8        ECHO                                                     ~5
    6     9        INIT_FCALL                                               'substr_replace'
         10        SEND_VAR                                                 !0
         11        SEND_VAL                                                 ''
         12        SEND_VAL                                                 -1
         13        SEND_VAL                                                 1
         14        DO_ICALL                                         $6      
         15        ASSIGN                                                   !0, $6
    7    16        INIT_FCALL                                               'chunk_split'
         17        SEND_VAR                                                 !0
         18        SEND_VAL                                                 2
         19        SEND_VAL                                                 '%2C'
         20        DO_ICALL                                         $8      
         21        CONCAT                                           ~9      $8, !1
         22        ASSIGN                                                   !0, ~9
    8    23        ECHO                                                     !0
    9    24      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.78 ms | 1395 KiB | 19 Q