3v4l.org

run code in 300+ PHP versions simultaneously
<?php $haystack = '12341234'; $needle = '23'; $replacer = ''; $start = strpos($haystack , $needle); $needleLen = strlen($needle); echo substr_replace ( $haystack , $replacer, $start , $needleLen );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/e3pLC
function name:  (null)
number of ops:  18
compiled vars:  !0 = $haystack, !1 = $needle, !2 = $replacer, !3 = $start, !4 = $needleLen
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '12341234'
    4     1        ASSIGN                                                   !1, '23'
    5     2        ASSIGN                                                   !2, ''
    6     3        INIT_FCALL                                               'strpos'
          4        SEND_VAR                                                 !0
          5        SEND_VAR                                                 !1
          6        DO_ICALL                                         $8      
          7        ASSIGN                                                   !3, $8
    8     8        STRLEN                                           ~10     !1
          9        ASSIGN                                                   !4, ~10
    9    10        INIT_FCALL                                               'substr_replace'
         11        SEND_VAR                                                 !0
         12        SEND_VAR                                                 !2
         13        SEND_VAR                                                 !3
         14        SEND_VAR                                                 !4
         15        DO_ICALL                                         $12     
         16        ECHO                                                     $12
         17      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.08 ms | 1394 KiB | 17 Q