3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = 'bar'; $str[1] = 'A'; echo $str; $char ='3'; $pos = '2'; $str = substr_replace($str,$char,$pos,1); echo $str;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2Hpu8
function name:  (null)
number of ops:  15
compiled vars:  !0 = $str, !1 = $char, !2 = $pos
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'bar'
    3     1        ASSIGN_DIM                                               !0, 1
          2        OP_DATA                                                  'A'
    4     3        ECHO                                                     !0
    5     4        ASSIGN                                                   !1, '3'
    6     5        ASSIGN                                                   !2, '2'
    7     6        INIT_FCALL                                               'substr_replace'
          7        SEND_VAR                                                 !0
          8        SEND_VAR                                                 !1
          9        SEND_VAR                                                 !2
         10        SEND_VAL                                                 1
         11        DO_ICALL                                         $7      
         12        ASSIGN                                                   !0, $7
    8    13        ECHO                                                     !0
         14      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
172.67 ms | 1394 KiB | 15 Q