3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "087777807209"; // Original string $replacement = "62"; // What you want to replace the last character with // The final string $final = $replacement.substr($string, 0, 1); echo $final;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/H49X6
function name:  (null)
number of ops:  11
compiled vars:  !0 = $string, !1 = $replacement, !2 = $final
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '087777807209'
    4     1        ASSIGN                                                   !1, '62'
    7     2        INIT_FCALL                                               'substr'
          3        SEND_VAR                                                 !0
          4        SEND_VAL                                                 0
          5        SEND_VAL                                                 1
          6        DO_ICALL                                         $5      
          7        CONCAT                                           ~6      !1, $5
          8        ASSIGN                                                   !2, ~6
    8     9        ECHO                                                     !2
         10      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
170.23 ms | 1394 KiB | 15 Q