3v4l.org

run code in 500+ PHP versions simultaneously
<?php $haystack3 = '<span class=\'descr\'>test, test2, test3</span> <span class=\'descr\'>test</span> <span class=\'descr\'>test4 test5</span>'; preg_match_all('#^<span class=\'descr\'>(.*?)</span>$#m', $haystack3, $matches3); $data3 = explode(',', $matches3[1]); $data3 = array_filter(array_unique(array_map('trim', $data3))); natsort($data3); echo '<b>' . join(', ' , $data3 ) . '</b>'; echo "<br>\n"; echo '<font color="blue">' . '<b>' . count( $data3 ) . '</b>' . '</font>' . " tags were found." . '<br>'; ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/A91Yj
function name:  (null)
number of ops:  42
compiled vars:  !0 = $haystack3, !1 = $matches3, !2 = $data3
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, '%3Cspan+class%3D%27descr%27%3Etest%2C+test2%2C+test3%3C%2Fspan%3E%0A%3Cspan+class%3D%27descr%27%3Etest%3C%2Fspan%3E%0A%3Cspan+class%3D%27descr%27%3Etest4+test5%3C%2Fspan%3E'
    6     1        INIT_FCALL                                                   'preg_match_all'
          2        SEND_VAL                                                     '%23%5E%3Cspan+class%3D%27descr%27%3E%28.%2A%3F%29%3C%2Fspan%3E%24%23m'
          3        SEND_VAR                                                     !0
          4        SEND_REF                                                     !1
          5        DO_ICALL                                                     
    7     6        INIT_FCALL                                                   'explode'
          7        SEND_VAL                                                     '%2C'
          8        FETCH_DIM_R                                          ~5      !1, 1
          9        SEND_VAL                                                     ~5
         10        DO_ICALL                                             $6      
         11        ASSIGN                                                       !2, $6
    8    12        INIT_FCALL                                                   'array_filter'
         13        INIT_FCALL                                                   'array_unique'
         14        INIT_FCALL                                                   'array_map'
         15        SEND_VAL                                                     'trim'
         16        SEND_VAR                                                     !2
         17        DO_ICALL                                             $8      
         18        SEND_VAR                                                     $8
         19        DO_ICALL                                             $9      
         20        SEND_VAR                                                     $9
         21        DO_ICALL                                             $10     
         22        ASSIGN                                                       !2, $10
    9    23        INIT_FCALL                                                   'natsort'
         24        SEND_REF                                                     !2
         25        DO_ICALL                                                     
   10    26        INIT_FCALL                                                   'join'
         27        SEND_VAL                                                     '%2C+'
         28        SEND_VAR                                                     !2
         29        DO_ICALL                                             $13     
         30        CONCAT                                               ~14     '%3Cb%3E', $13
         31        CONCAT                                               ~15     ~14, '%3C%2Fb%3E'
         32        ECHO                                                         ~15
   11    33        ECHO                                                         '%3Cbr%3E%0A'
   12    34        COUNT                                                ~16     !2
         35        CONCAT                                               ~17     '%3Cfont+color%3D%22blue%22%3E%3Cb%3E', ~16
         36        CONCAT                                               ~18     ~17, '%3C%2Fb%3E'
         37        CONCAT                                               ~19     ~18, '%3C%2Ffont%3E'
         38        CONCAT                                               ~20     ~19, '+tags+were+found.'
         39        CONCAT                                               ~21     ~20, '%3Cbr%3E'
         40        ECHO                                                         ~21
   13    41      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
194.03 ms | 1488 KiB | 20 Q