3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = array('some-key' => 'Needle Value'); $string = 'I am the Needle Value'; foreach ($data as $key => $val) { if(strstr($string, $val)) { $string = str_replace($val, '<a href="'.$key.'">'.$val.'</a>', $string); } } echo $string;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 21
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 21
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 20
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 20
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
filename:       /in/8dW8K
function name:  (null)
number of ops:  24
compiled vars:  !0 = $data, !1 = $string, !2 = $val, !3 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1        ASSIGN                                                   !1, 'I+am+the+Needle+Value'
    7     2      > FE_RESET_R                                       $6      !0, ->21
          3    > > FE_FETCH_R                                       ~7      $6, !2, ->21
          4    >   ASSIGN                                                   !3, ~7
    8     5        INIT_FCALL                                               'strstr'
          6        SEND_VAR                                                 !1
          7        SEND_VAR                                                 !2
          8        DO_ICALL                                         $9      
          9      > JMPZ                                                     $9, ->20
    9    10    >   INIT_FCALL                                               'str_replace'
         11        SEND_VAR                                                 !2
         12        CONCAT                                           ~10     '%3Ca+href%3D%22', !3
         13        CONCAT                                           ~11     ~10, '%22%3E'
         14        CONCAT                                           ~12     ~11, !2
         15        CONCAT                                           ~13     ~12, '%3C%2Fa%3E'
         16        SEND_VAL                                                 ~13
         17        SEND_VAR                                                 !1
         18        DO_ICALL                                         $14     
         19        ASSIGN                                                   !1, $14
    7    20    > > JMP                                                      ->3
         21    >   FE_FREE                                                  $6
   13    22        ECHO                                                     !1
         23      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.88 ms | 1395 KiB | 17 Q