3v4l.org

run code in 300+ PHP versions simultaneously
<?php function parseStopWords($text){ $text = preg_replace('/[a-zA-Z0-9áéíóúñ\', ]/i','',$text); $stopwords = array('a','ante','bajo','cabe','con','contra','de','desde','en','entre','hacia','hasta','para','por','sin','sobre','tras','el','lo','la','los','las','un','unos','una','al','del','que','es','se','y','fue'); foreach($stopwords as $w){ $text = preg_replace('/\b'.$w.'\b/i','',$text); } $text = preg_replace('/\s{2,}/i',' ',$text); return $text; } $texto = "Prueba de parseStop worlds para , probar la prueba"; var_dump(parseStopWords($texto));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/u55BI
function name:  (null)
number of ops:  8
compiled vars:  !0 = $texto
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   ASSIGN                                                   !0, 'Prueba+de+parseStop+worlds+para+%2C+probar+la+prueba'
   16     1        INIT_FCALL                                               'var_dump'
          2        INIT_FCALL                                               'parsestopwords'
          3        SEND_VAR                                                 !0
          4        DO_FCALL                                      0  $2      
          5        SEND_VAR                                                 $2
          6        DO_ICALL                                                 
          7      > RETURN                                                   1

Function parsestopwords:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 9, Position 2 = 19
Branch analysis from position: 9
2 jumps found. (Code = 78) Position 1 = 10, Position 2 = 19
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
filename:       /in/u55BI
function name:  parseStopWords
number of ops:  28
compiled vars:  !0 = $text, !1 = $stopwords, !2 = $w
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    4     1        INIT_FCALL                                               'preg_replace'
          2        SEND_VAL                                                 '%2F%5Ba-zA-Z0-9%C3%A1%C3%A9%C3%AD%C3%B3%C3%BA%C3%B1%27%2C+%5D%2Fi'
          3        SEND_VAL                                                 ''
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $3      
          6        ASSIGN                                                   !0, $3
    5     7        ASSIGN                                                   !1, <array>
    6     8      > FE_RESET_R                                       $6      !1, ->19
          9    > > FE_FETCH_R                                               $6, !2, ->19
    7    10    >   INIT_FCALL                                               'preg_replace'
         11        CONCAT                                           ~7      '%2F%5Cb', !2
         12        CONCAT                                           ~8      ~7, '%5Cb%2Fi'
         13        SEND_VAL                                                 ~8
         14        SEND_VAL                                                 ''
         15        SEND_VAR                                                 !0
         16        DO_ICALL                                         $9      
         17        ASSIGN                                                   !0, $9
    6    18      > JMP                                                      ->9
         19    >   FE_FREE                                                  $6
    9    20        INIT_FCALL                                               'preg_replace'
         21        SEND_VAL                                                 '%2F%5Cs%7B2%2C%7D%2Fi'
         22        SEND_VAL                                                 '+'
         23        SEND_VAR                                                 !0
         24        DO_ICALL                                         $11     
         25        ASSIGN                                                   !0, $11
   11    26      > RETURN                                                   !0
   12    27*     > RETURN                                                   null

End of function parsestopwords

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.14 ms | 1402 KiB | 18 Q