3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = " <meta charset='UTF-8'> <meta name='keywords' content='your, tags'> <meta name='description' content='150 words'> <meta name='subject' content='your website's subject'> <meta name='copyright' content='company name'> <meta name='language' content='ES'> <meta name='robots' content='index,follow'> <meta name='revised' content='Sunday, July 18th, 2010, 5:15 pm'> <meta name='abstract' content=''> <meta name='topic' content=''> <meta name='summary' content=''> <meta name='Classification' content='Business'> <meta name='author' content='name, email@hotmail.com'> <meta name='designer' content=''> <meta name='reply-to' content='email@hotmail.com'> <meta name='owner' content=''> <meta name='url' content='http://www.websiteaddrress.com'> <meta name='identifier-URL' content='http://www.websiteaddress.com'> <meta name='directory' content='submission'> <meta name='pagename' content='jQuery Tools, Tutorials and Resources - O'Reilly Media'> <meta name='category' content=''> <meta name='coverage' content='Worldwide'> <meta name='distribution' content='Global'> <meta name='rating' content='General'> <meta name='revisit-after' content='7 days'> <meta name='subtitle' content='This is my subtitle'> <meta name='target' content='all'> <meta name='HandheldFriendly' content='True'> <meta name='MobileOptimized' content='320'> <meta name='date' content='Sep. 27, 2010'> <meta name='search_date' content='2010-09-27'> <meta name='DC.title' content='Unstoppable Robot Ninja'> <meta name='ResourceLoaderDynamicStyles' content=''> <meta name='medium' content='blog'> <meta name='syndication-source' content='https://mashable.com/2008/12/24/free-brand-monitoring-tools/'> <meta name='original-source' content='https://mashable.com/2008/12/24/free-brand-monitoring-tools/'> <meta name='verify-v1' content='dV1r/ZJJdDEI++fKJ6iDEl6o+TMNtSu0kv18ONeqM0I='> <meta name='y_key' content='1e39c508e0d87750'> <meta name='pageKey' content='guest-home'> <meta itemprop='name' content='jQTouch'> <meta http-equiv='Expires' content='0'> <meta http-equiv='Pragma' content='no-cache'> <meta http-equiv='Cache-Control' content='no-cache'> <meta http-equiv='imagetoolbar' content='no'> <meta http-equiv='x-dns-prefetch-control' content='off'>"; //var_export(preg_match_all("~<meta (?:name|http-equiv)='(.*)' content='(.*)'>~", $html, $matches, PREG_SET_ORDER) ? $matches : 'fail'); $result = []; $dom=new DOMDocument; libxml_use_internal_errors(true); // do not display warnings on erroneous lines $dom->loadHTML($html); $xpath = new DOMXPath($dom); foreach ($xpath->evaluate("//meta[(@name or @http-equiv) and @content]") as $node) { // target <meta> tags containing both a name & content attribute if ($value = $node->getAttribute('name')) { $attr = 'name'; } else { $attr = 'http-equiv'; $value = $node->getAttribute('http-equiv'); } $result[]=[$attr => $value, 'content' => $node->getAttribute('content')]; } var_export($result);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 19, Position 2 = 40
Branch analysis from position: 19
2 jumps found. (Code = 78) Position 1 = 20, Position 2 = 40
Branch analysis from position: 20
2 jumps found. (Code = 43) Position 1 = 25, Position 2 = 27
Branch analysis from position: 25
1 jumps found. (Code = 42) Position 1 = 32
Branch analysis from position: 32
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
Branch analysis from position: 27
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
Branch analysis from position: 40
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 40
filename:       /in/7dQK4
function name:  (null)
number of ops:  45
compiled vars:  !0 = $html, !1 = $result, !2 = $dom, !3 = $xpath, !4 = $node, !5 = $value, !6 = $attr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%0A%3Cmeta+charset%3D%27UTF-8%27%3E%0A%3Cmeta+name%3D%27keywords%27+content%3D%27your%2C+tags%27%3E%0A%3Cmeta+name%3D%27description%27+content%3D%27150+words%27%3E%0A%3Cmeta+name%3D%27subject%27+content%3D%27your+website%27s+subject%27%3E%0A%3Cmeta+name%3D%27copyright%27+content%3D%27company+name%27%3E%0A%3Cmeta+name%3D%27language%27+content%3D%27ES%27%3E%0A%3Cmeta+name%3D%27robots%27+content%3D%27index%2Cfollow%27%3E%0A%3Cmeta+name%3D%27revised%27+content%3D%27Sunday%2C+July+18th%2C+2010%2C+5%3A15+pm%27%3E%0A%3Cmeta+name%3D%27abstract%27+content%3D%27%27%3E%0A%3Cmeta+name%3D%27topic%27+content%3D%27%27%3E%0A%3Cmeta+name%3D%27summary%27+content%3D%27%27%3E%0A%3Cmeta+name%3D%27Classification%27+content%3D%27Business%27%3E%0A%3Cmeta+name%3D%27author%27+content%3D%27name%2C+email%40hotmail.com%27%3E%0A%3Cmeta+name%3D%27designer%27+content%3D%27%27%3E%0A%3Cmeta+name%3D%27reply-to%27+content%3D%27email%40hotmail.com%27%3E%0A%3Cmeta+name%3D%27owner%27+content%3D%27%27%3E%0A%3Cmeta+name%3D%27url%27+content%3D%27http%3A%2F%2Fwww.websiteaddrress.com%27%3E%0A%3Cmeta+name%3D%27identifier-URL%27+content%3D%27http%3A%2F%2Fwww.websiteaddress.com%27%3E%0A%3Cmeta+name%3D%27directory%27+content%3D%27submission%27%3E%0A%3Cmeta+name%3D%27pagename%27+content%3D%27jQuery+Tools%2C+Tutorials+and+Resources+-+O%27Reilly+Media%27%3E%0A%3Cmeta+name%3D%27category%27+content%3D%27%27%3E%0A%3Cmeta+name%3D%27coverage%27+content%3D%27Worldwide%27%3E%0A%3Cmeta+name%3D%27distribution%27+content%3D%27Global%27%3E%0A%3Cmeta+name%3D%27rating%27+content%3D%27General%27%3E%0A%3Cmeta+name%3D%27revisit-after%27+content%3D%277+days%27%3E%0A%3Cmeta+name%3D%27subtitle%27+content%3D%27This+is+my+subtitle%27%3E%0A%3Cmeta+name%3D%27target%27+content%3D%27all%27%3E%0A%3Cmeta+name%3D%27HandheldFriendly%27+content%3D%27True%27%3E%0A%3Cmeta+name%3D%27MobileOptimized%27+content%3D%27320%27%3E%0A%3Cmeta+name%3D%27date%27+content%3D%27Sep.+27%2C+2010%27%3E%0A%3Cmeta+name%3D%27search_date%27+content%3D%272010-09-27%27%3E%0A%3Cmeta+name%3D%27DC.title%27+content%3D%27Unstoppable+Robot+Ninja%27%3E%0A%3Cmeta+name%3D%27ResourceLoaderDynamicStyles%27+content%3D%27%27%3E%0A%3Cmeta+name%3D%27medium%27+content%3D%27blog%27%3E%0A%3Cmeta+name%3D%27syndication-source%27+content%3D%27https%3A%2F%2Fmashable.com%2F2008%2F12%2F24%2Ffree-brand-monitoring-tools%2F%27%3E%0A%3Cmeta+name%3D%27original-source%27+content%3D%27https%3A%2F%2Fmashable.com%2F2008%2F12%2F24%2Ffree-brand-monitoring-tools%2F%27%3E%0A%3Cmeta+name%3D%27verify-v1%27+content%3D%27dV1r%2FZJJdDEI%2B%2BfKJ6iDEl6o%2BTMNtSu0kv18ONeqM0I%3D%27%3E%0A%3Cmeta+name%3D%27y_key%27+content%3D%271e39c508e0d87750%27%3E%0A%3Cmeta+name%3D%27pageKey%27+content%3D%27guest-home%27%3E%0A%3Cmeta+itemprop%3D%27name%27+content%3D%27jQTouch%27%3E%0A%3Cmeta+http-equiv%3D%27Expires%27+content%3D%270%27%3E%0A%3Cmeta+http-equiv%3D%27Pragma%27+content%3D%27no-cache%27%3E%0A%3Cmeta+http-equiv%3D%27Cache-Control%27+content%3D%27no-cache%27%3E%0A%3Cmeta+http-equiv%3D%27imagetoolbar%27+content%3D%27no%27%3E%0A%3Cmeta+http-equiv%3D%27x-dns-prefetch-control%27+content%3D%27off%27%3E'
   52     1        ASSIGN                                                   !1, <array>
   53     2        NEW                                              $9      'DOMDocument'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !2, $9
   54     5        INIT_FCALL                                               'libxml_use_internal_errors'
          6        SEND_VAL                                                 <true>
          7        DO_ICALL                                                 
   55     8        INIT_METHOD_CALL                                         !2, 'loadHTML'
          9        SEND_VAR_EX                                              !0
         10        DO_FCALL                                      0          
   56    11        NEW                                              $14     'DOMXPath'
         12        SEND_VAR_EX                                              !2
         13        DO_FCALL                                      0          
         14        ASSIGN                                                   !3, $14
   57    15        INIT_METHOD_CALL                                         !3, 'evaluate'
         16        SEND_VAL_EX                                              '%2F%2Fmeta%5B%28%40name+or+%40http-equiv%29+and+%40content%5D'
         17        DO_FCALL                                      0  $17     
         18      > FE_RESET_R                                       $18     $17, ->40
         19    > > FE_FETCH_R                                               $18, !4, ->40
   58    20    >   INIT_METHOD_CALL                                         !4, 'getAttribute'
         21        SEND_VAL_EX                                              'name'
         22        DO_FCALL                                      0  $19     
         23        ASSIGN                                           ~20     !5, $19
         24      > JMPZ                                                     ~20, ->27
   59    25    >   ASSIGN                                                   !6, 'name'
   58    26      > JMP                                                      ->32
   61    27    >   ASSIGN                                                   !6, 'http-equiv'
   62    28        INIT_METHOD_CALL                                         !4, 'getAttribute'
         29        SEND_VAL_EX                                              'http-equiv'
         30        DO_FCALL                                      0  $23     
         31        ASSIGN                                                   !5, $23
   64    32    >   INIT_ARRAY                                       ~26     !5, !6
         33        INIT_METHOD_CALL                                         !4, 'getAttribute'
         34        SEND_VAL_EX                                              'content'
         35        DO_FCALL                                      0  $27     
         36        ADD_ARRAY_ELEMENT                                ~26     $27, 'content'
         37        ASSIGN_DIM                                               !1
         38        OP_DATA                                                  ~26
   57    39      > JMP                                                      ->19
         40    >   FE_FREE                                                  $18
   67    41        INIT_FCALL                                               'var_export'
         42        SEND_VAR                                                 !1
         43        DO_ICALL                                                 
         44      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.67 ms | 1016 KiB | 15 Q