3v4l.org

run code in 300+ PHP versions simultaneously
<?php $tdr="<p>Previous reports stated that the Pokemon Alpha.</p><p>On the other hand, Pokemon Diamond and Pearl are reported .</p><p>On the other hand, Pokemon Diamond and Pearl are reported.</p>"; $pos = strrpos($tdr, '<p>'); $newtdr = substr($tdr,0,$pos) . ' Hello <p>' . substr($tdr, $pos + 4); echo $newtdr;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OTVJp
function name:  (null)
number of ops:  21
compiled vars:  !0 = $tdr, !1 = $pos, !2 = $newtdr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%3Cp%3EPrevious+reports+stated+that+the+Pokemon+Alpha.%3C%2Fp%3E%3Cp%3EOn+the+other+hand%2C+Pokemon+Diamond+and+Pearl+are+reported+.%3C%2Fp%3E%3Cp%3EOn+the+other+hand%2C+Pokemon+Diamond+and+Pearl+are+reported.%3C%2Fp%3E'
    4     1        INIT_FCALL                                               'strrpos'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 '%3Cp%3E'
          4        DO_ICALL                                         $4      
          5        ASSIGN                                                   !1, $4
    6     6        INIT_FCALL                                               'substr'
          7        SEND_VAR                                                 !0
          8        SEND_VAL                                                 0
          9        SEND_VAR                                                 !1
         10        DO_ICALL                                         $6      
         11        CONCAT                                           ~7      $6, '+Hello+%3Cp%3E'
         12        INIT_FCALL                                               'substr'
         13        SEND_VAR                                                 !0
         14        ADD                                              ~8      !1, 4
         15        SEND_VAL                                                 ~8
         16        DO_ICALL                                         $9      
         17        CONCAT                                           ~10     ~7, $9
         18        ASSIGN                                                   !2, ~10
    8    19        ECHO                                                     !2
         20      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.18 ms | 1395 KiB | 17 Q