3v4l.org

run code in 300+ PHP versions simultaneously
<?php $id = '23423'; $s = '|'; $text = 'content to insert'; $data_update = "Some text 23423 in between end\nsome text"; $data_update = preg_replace('/\b(' . $id . '\b.*)(\R)/', '$1 ' . $text . '$2', $data_update, 1); echo $data_update;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pRtIQ
function name:  (null)
number of ops:  17
compiled vars:  !0 = $id, !1 = $s, !2 = $text, !3 = $data_update
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '23423'
    4     1        ASSIGN                                                   !1, '%7C'
    5     2        ASSIGN                                                   !2, 'content+to+insert'
    6     3        ASSIGN                                                   !3, 'Some+text+23423+in+between+end%0Asome+text'
    7     4        INIT_FCALL                                               'preg_replace'
          5        CONCAT                                           ~8      '%2F%5Cb%28', !0
          6        CONCAT                                           ~9      ~8, '%5Cb.%2A%29%28%5CR%29%2F'
          7        SEND_VAL                                                 ~9
          8        CONCAT                                           ~10     '%241+', !2
          9        CONCAT                                           ~11     ~10, '%242'
         10        SEND_VAL                                                 ~11
         11        SEND_VAR                                                 !3
         12        SEND_VAL                                                 1
         13        DO_ICALL                                         $12     
         14        ASSIGN                                                   !3, $12
    8    15        ECHO                                                     !3
    9    16      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
138.75 ms | 1009 KiB | 14 Q