3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = 'Samsung UN32EH4003 32-inch 720p 60Hz LED HDTV (Black)'; echo shorten_string($string); $arr=array(); preg_match_all('/\b([0-9A-Za-z]{3,})\b/', $string, $arr); $keywords = array_slice(array_unique($arr[0]),0,3); echo join('<br/>', $keywords);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/X4ZkC
function name:  (null)
number of ops:  27
compiled vars:  !0 = $string, !1 = $arr, !2 = $keywords
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'Samsung+UN32EH4003+32-inch+720p+60Hz+LED+HDTV+%28Black%29'
    3     1        INIT_FCALL_BY_NAME                                       'shorten_string'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0  $4      
          4        ECHO                                                     $4
    4     5        ASSIGN                                                   !1, <array>
    5     6        INIT_FCALL                                               'preg_match_all'
          7        SEND_VAL                                                 '%2F%5Cb%28%5B0-9A-Za-z%5D%7B3%2C%7D%29%5Cb%2F'
          8        SEND_VAR                                                 !0
          9        SEND_REF                                                 !1
         10        DO_ICALL                                                 
    6    11        INIT_FCALL                                               'array_slice'
         12        INIT_FCALL                                               'array_unique'
         13        FETCH_DIM_R                                      ~7      !1, 0
         14        SEND_VAL                                                 ~7
         15        DO_ICALL                                         $8      
         16        SEND_VAR                                                 $8
         17        SEND_VAL                                                 0
         18        SEND_VAL                                                 3
         19        DO_ICALL                                         $9      
         20        ASSIGN                                                   !2, $9
    7    21        INIT_FCALL                                               'join'
         22        SEND_VAL                                                 '%3Cbr%2F%3E'
         23        SEND_VAR                                                 !2
         24        DO_ICALL                                         $11     
         25        ECHO                                                     $11
         26      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.12 ms | 1399 KiB | 21 Q