3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.89 ms | 1394 KiB | 17 Q