3v4l.org

run code in 300+ PHP versions simultaneously
<?php $content = "gaja nagaja"; $token = "gaja"; $replaced = preg_replace("\\b{$token}\\b", "<span>{$token}</span>"); echo $replaced;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gaUKF
function name:  (null)
number of ops:  15
compiled vars:  !0 = $content, !1 = $token, !2 = $replaced
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'gaja+nagaja'
    4     1        ASSIGN                                                   !1, 'gaja'
    6     2        INIT_FCALL                                               'preg_replace'
          3        ROPE_INIT                                     3  ~6      '%5Cb'
          4        ROPE_ADD                                      1  ~6      ~6, !1
          5        ROPE_END                                      2  ~5      ~6, '%5Cb'
          6        SEND_VAL                                                 ~5
          7        ROPE_INIT                                     3  ~9      '%3Cspan%3E'
          8        ROPE_ADD                                      1  ~9      ~9, !1
          9        ROPE_END                                      2  ~8      ~9, '%3C%2Fspan%3E'
         10        SEND_VAL                                                 ~8
         11        DO_ICALL                                         $11     
         12        ASSIGN                                                   !2, $11
    8    13        ECHO                                                     !2
         14      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.95 ms | 1394 KiB | 15 Q