3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str="This is a test - That game is awesome (Cristiano Ronaldo is a great Soccer Player)"; //first explode it $e=explode(' ',$str); //loop to remove short words and special characters $out=array(); foreach ($e as $a){ $a=preg_replace("/[^A-Za-z0-9 ]/", '', $a); if(strlen($a)>2){ $out[]=$a; } } print_r($out);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 21
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 21
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 18, Position 2 = 20
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
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/WRiU6
function name:  (null)
number of ops:  26
compiled vars:  !0 = $str, !1 = $e, !2 = $out, !3 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, 'This+is+a+test+-+That+game+is+awesome+%28Cristiano+Ronaldo+is+a+great+Soccer+Player%29'
    7     1        INIT_FCALL                                               'explode'
          2        SEND_VAL                                                 '+'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $5      
          5        ASSIGN                                                   !1, $5
   10     6        ASSIGN                                                   !2, <array>
   11     7      > FE_RESET_R                                       $8      !1, ->21
          8    > > FE_FETCH_R                                               $8, !3, ->21
   13     9    >   INIT_FCALL                                               'preg_replace'
         10        SEND_VAL                                                 '%2F%5B%5EA-Za-z0-9+%5D%2F'
         11        SEND_VAL                                                 ''
         12        SEND_VAR                                                 !3
         13        DO_ICALL                                         $9      
         14        ASSIGN                                                   !3, $9
   15    15        STRLEN                                           ~11     !3
         16        IS_SMALLER                                               2, ~11
         17      > JMPZ                                                     ~12, ->20
   16    18    >   ASSIGN_DIM                                               !2
         19        OP_DATA                                                  !3
   11    20    > > JMP                                                      ->8
         21    >   FE_FREE                                                  $8
   20    22        INIT_FCALL                                               'print_r'
         23        SEND_VAR                                                 !2
         24        DO_ICALL                                                 
         25      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.11 ms | 1388 KiB | 19 Q