3v4l.org

run code in 300+ PHP versions simultaneously
<?php $vocabolario = array("La", "mia", "una", "prova", "con", "del", "testo"); function wordCheck($word) { global $vocabolario; $word = $word[0]; if (in_array($word, $vocabolario)) { return $word; } return '<u>'.$word.'</u>'; } function textCheck($text) { return preg_replace_callback('#(?!<.*?)\w+(?![^<>]*?>)#','wordCheck', $text); } echo textCheck("La mia รจ una provaa con del testo: <a href='http://pippo.it'>html</a>.");
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vgZOC
function name:  (null)
number of ops:  6
compiled vars:  !0 = $vocabolario
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   20     1        INIT_FCALL                                               'textcheck'
          2        SEND_VAL                                                 'La+mia+%C3%A8+una+provaa+con+del+testo%3A+%3Ca+href%3D%27http%3A%2F%2Fpippo.it%27%3Ehtml%3C%2Fa%3E.'
          3        DO_FCALL                                      0  $2      
          4        ECHO                                                     $2
          5      > RETURN                                                   1

Function wordcheck:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 10
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vgZOC
function name:  wordCheck
number of ops:  14
compiled vars:  !0 = $word, !1 = $vocabolario
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    6     1        BIND_GLOBAL                                              !1, 'vocabolario'
    7     2        FETCH_DIM_R                                      ~2      !0, 0
          3        ASSIGN                                                   !0, ~2
    9     4        INIT_FCALL                                               'in_array'
          5        SEND_VAR                                                 !0
          6        SEND_VAR                                                 !1
          7        DO_ICALL                                         $4      
          8      > JMPZ                                                     $4, ->10
   10     9    > > RETURN                                                   !0
   13    10    >   CONCAT                                           ~5      '%3Cu%3E', !0
         11        CONCAT                                           ~6      ~5, '%3C%2Fu%3E'
         12      > RETURN                                                   ~6
   14    13*     > RETURN                                                   null

End of function wordcheck

Function textcheck:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vgZOC
function name:  textCheck
number of ops:  8
compiled vars:  !0 = $text
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   RECV                                             !0      
   17     1        INIT_FCALL                                               'preg_replace_callback'
          2        SEND_VAL                                                 '%23%28%3F%21%3C.%2A%3F%29%5Cw%2B%28%3F%21%5B%5E%3C%3E%5D%2A%3F%3E%29%23'
          3        SEND_VAL                                                 'wordCheck'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $1      
          6      > RETURN                                                   $1
   18     7*     > RETURN                                                   null

End of function textcheck

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
224.79 ms | 1002 KiB | 16 Q