3v4l.org

run code in 500+ PHP versions simultaneously
<?php $str = "<td class='postac'>Actelsar </td> <td class='postac'>tabl. 80 mg 28 tabl.</td> <td class='postac'> 3 &lt; 4</td><td class=\"postac\"> or <td class= 'postac'> or <td class='postac' > or <td class='postac' id='foo'> or <td class='postac'>"; preg_match_all("/<td class='postac'>([^<]+)</", $str,$m); $doc = new DOMDocument(); $doc->loadHTML($str); $xpath = new DOMXPath($doc); $nodes = $xpath->query('//td[@class="postac"]'); $result = array(); for($i=0;$i<$nodes->length; $i++){ $text = $nodes->item($i)->textContent; if(isset($text[0])&&ctype_upper($text[0])) $result[]= $text; } print_r($m[1]); print_r($result); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 39
Branch analysis from position: 39
2 jumps found. (Code = 44) Position 1 = 42, Position 2 = 23
Branch analysis from position: 42
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 23
2 jumps found. (Code = 46) Position 1 = 30, Position 2 = 35
Branch analysis from position: 30
2 jumps found. (Code = 43) Position 1 = 36, Position 2 = 38
Branch analysis from position: 36
2 jumps found. (Code = 44) Position 1 = 42, Position 2 = 23
Branch analysis from position: 42
Branch analysis from position: 23
Branch analysis from position: 38
Branch analysis from position: 35
filename:       /in/2Vf3J
function name:  (null)
number of ops:  50
compiled vars:  !0 = $str, !1 = $m, !2 = $doc, !3 = $xpath, !4 = $nodes, !5 = $result, !6 = $i, !7 = $text
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                       !0, '%3Ctd+class%3D%27postac%27%3EActelsar+%3C%2Ftd%3E%0A%3Ctd+class%3D%27postac%27%3Etabl.+80+mg+28+tabl.%3C%2Ftd%3E%0A%3Ctd+class%3D%27postac%27%3E+3+%26lt%3B+4%3C%2Ftd%3E%3Ctd+class%3D%22postac%22%3E+or+%3Ctd+class%3D+%27postac%27%3E+or+%3Ctd+class%3D%27postac%27+%3E+or+%3Ctd+class%3D%27postac%27+id%3D%27foo%27%3E+or+%3Ctd+class%3D%27postac%27%3E'
    6     1        INIT_FCALL                                                   'preg_match_all'
          2        SEND_VAL                                                     '%2F%3Ctd+class%3D%27postac%27%3E%28%5B%5E%3C%5D%2B%29%3C%2F'
          3        SEND_VAR                                                     !0
          4        SEND_REF                                                     !1
          5        DO_ICALL                                                     
    8     6        NEW                                                  $10     'DOMDocument'
          7        DO_FCALL                                          0          
          8        ASSIGN                                                       !2, $10
    9     9        INIT_METHOD_CALL                                             !2, 'loadHTML'
         10        SEND_VAR_EX                                                  !0
         11        DO_FCALL                                          0          
   10    12        NEW                                                  $14     'DOMXPath'
         13        SEND_VAR_EX                                                  !2
         14        DO_FCALL                                          0          
         15        ASSIGN                                                       !3, $14
   11    16        INIT_METHOD_CALL                                             !3, 'query'
         17        SEND_VAL_EX                                                  '%2F%2Ftd%5B%40class%3D%22postac%22%5D'
         18        DO_FCALL                                          0  $17     
         19        ASSIGN                                                       !4, $17
   12    20        ASSIGN                                                       !5, <array>
   13    21        ASSIGN                                                       !6, 0
         22      > JMP                                                          ->39
   14    23    >   INIT_METHOD_CALL                                             !4, 'item'
         24        SEND_VAR_EX                                                  !6
         25        DO_FCALL                                          0  $21     
         26        FETCH_OBJ_R                                          ~22     $21, 'textContent'
         27        ASSIGN                                                       !7, ~22
   15    28        ISSET_ISEMPTY_DIM_OBJ                             0  ~24     !7, 0
         29      > JMPZ_EX                                              ~24     ~24, ->35
         30    >   INIT_FCALL                                                   'ctype_upper'
         31        FETCH_DIM_R                                          ~25     !7, 0
         32        SEND_VAL                                                     ~25
         33        DO_ICALL                                             $26     
         34        BOOL                                                 ~24     $26
         35    > > JMPZ                                                         ~24, ->38
         36    >   ASSIGN_DIM                                                   !5
         37        OP_DATA                                                      !7
   13    38    >   PRE_INC                                                      !6
         39    >   FETCH_OBJ_R                                          ~29     !4, 'length'
         40        IS_SMALLER                                                   !6, ~29
         41      > JMPNZ                                                        ~30, ->23
   18    42    >   INIT_FCALL                                                   'print_r'
         43        FETCH_DIM_R                                          ~31     !1, 1
         44        SEND_VAL                                                     ~31
         45        DO_ICALL                                                     
   19    46        INIT_FCALL                                                   'print_r'
         47        SEND_VAR                                                     !5
         48        DO_ICALL                                                     
   20    49      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
218.72 ms | 3399 KiB | 16 Q