3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = <<<HTML <div class="entry-content entry-excerpt clearfix"> <div class="simplesocialbuttons simplesocial-round-icon simplesocialbuttons_inline simplesocialbuttons-align-centered post-1 post simplesocialbuttons-inline-no-animation simplesocialbuttons-inline-in"> <button class="simplesocial-fb-share" target="_blank" data-href="https://www.facebook.com/sharer/sharer.php?u=http://localhost/wp/hello-world/" onclick="javascript:window.open(this.dataset.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;"><span class="simplesocialtxt">Facebook </span> </button> <button class="simplesocial-msng-share" onclick="javascript:window.open( this.dataset.href, '_blank', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600' );return false;" data-href="http://www.facebook.com/dialog/send?app_id=891268654262273&amp;redirect_uri=http%3A%2F%2Flocalhost%2Fwp%2Fhello-world%2F&amp;link=http%3A%2F%2Flocalhost%2Fwp%2Fhello-world%2F&amp;display=popup"><span class="simplesocialtxt">Messenger</span></button> <button onclick="javascript:window.open(this.dataset.href, '_blank' );return false;" class="simplesocial-whatsapp-share" data-href="https://api.whatsapp.com/send?text=http://localhost/wp/hello-world/"><span class="simplesocialtxt">WhatsApp</span></button> <button class="simplesocial-tumblr-share" data-href="http://tumblr.com/widgets/share/tool?canonicalUrl=http%3A%2F%2Flocalhost%2Fwp%2Fhello-world%2F" onclick="javascript:window.open(this.dataset.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;"><span class="simplesocialtxt">Tumblr</span> </button> <button class="simplesocial-twt-share" data-href="https://twitter.com/share?text=Hello+world%21&amp;url=http://localhost/wp/hello-world/" rel="nofollow" onclick="javascript:window.open(this.dataset.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;"><span class="simplesocialtxt">Twitter</span> </button> <button onclick="javascript:window.location.href = this.dataset.href;return false;" class="simplesocial-email-share" data-href="mailto:?subject=Hello+world%21&amp;body=http://localhost/wp/hello-world/"><span class="simplesocialtxt">Email</span></button> <button class="simplesocial-gplus-share" data-href="https://plus.google.com/share?url=http://localhost/wp/hello-world/" onclick="javascript:window.open(this.dataset.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;"><span class="simplesocialtxt">Google+</span></button> <button target="popup" class="simplesocial-linkedin-share" data-href="https://www.linkedin.com/cws/share?url=http://localhost/wp/hello-world/" onclick="javascript:window.open(this.dataset.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;"><span class="simplesocialtxt">LinkedIn</span></button> <button rel="nofollow" class="simplesocial-pinterest-share" onclick="var e=document.createElement('script');e.setAttribute('type','text/javascript');e.setAttribute('charset','UTF-8');e.setAttribute('src','//assets.pinterest.com/js/pinmarklet.js?r='+Math.random()*99999999);document.body.appendChild(e);return false;"><span class="simplesocialtxt">Pinterest</span></button> <button class="simplesocial-reddit-share" data-href="https://reddit.com/submit?url=http://localhost/wp/hello-world/&amp;title=Hello+world%21" onclick="javascript:window.open(this.dataset.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;"><span class="simplesocialtxt">Reddit</span> </button> </div> <p>Wel&shy;come to Word&shy;Press.<br> <img class="alignnone size-medium wp-image-8" src="http://localhost/wp/wp-content/uploads/2018/07/DZV_1UkX4AEUlTZ-300x202.jpg" alt="" width="300" height="202" srcset="http://localhost/wp/wp-content/uploads/2018/07/DZV_1UkX4AEUlTZ-300x202.jpg 300w, http://localhost/wp/wp-content/uploads/2018/07/DZV_1UkX4AEUlTZ-768x517.jpg 768w, http://localhost/wp/wp-content/uploads/2018/07/DZV_1UkX4AEUlTZ.jpg 789w" sizes="(max-width: 300px) 100vw, 300px"><br> This is your first post. Edit or delete it, then start writ&shy;ing!</p> <a href="http://localhost/wp/hello-world/" class="more-link">Read more</a> </div> HTML; $dom = new DOMDocument; $dom->loadHTML($html, LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD); $xpath = new DOMXPath($dom); // using a loop in case there are multiple occurrences foreach ($xpath->query("//div[contains(@class, 'simplesocialbuttons')]") as $node) { $node->parentNode->removeChild($node); } echo $dom->saveHTML();
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 16, Position 2 = 22
Branch analysis from position: 16
2 jumps found. (Code = 78) Position 1 = 17, Position 2 = 22
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
filename:       /in/4Prhd
function name:  (null)
number of ops:  27
compiled vars:  !0 = $html, !1 = $dom, !2 = $xpath, !3 = $node
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%3Cdiv+class%3D%22entry-content+entry-excerpt+clearfix%22%3E%0A++++++++%3Cdiv+class%3D%22simplesocialbuttons+simplesocial-round-icon+simplesocialbuttons_inline+simplesocialbuttons-align-centered+post-1+post++simplesocialbuttons-inline-no-animation+simplesocialbuttons-inline-in%22%3E%0A%3Cbutton+class%3D%22simplesocial-fb-share%22+target%3D%22_blank%22+data-href%3D%22https%3A%2F%2Fwww.facebook.com%2Fsharer%2Fsharer.php%3Fu%3Dhttp%3A%2F%2Flocalhost%2Fwp%2Fhello-world%2F%22+onclick%3D%22javascript%3Awindow.open%28this.dataset.href%2C+%27%27%2C+%27menubar%3Dno%2Ctoolbar%3Dno%2Cresizable%3Dyes%2Cscrollbars%3Dyes%2Cheight%3D600%2Cwidth%3D600%27%29%3Breturn+false%3B%22%3E%3Cspan+class%3D%22simplesocialtxt%22%3EFacebook+%3C%2Fspan%3E+%3C%2Fbutton%3E%0A%3Cbutton+class%3D%22simplesocial-msng-share%22+onclick%3D%22javascript%3Awindow.open%28+this.dataset.href%2C+%27_blank%27%2C++%27menubar%3Dno%2Ctoolbar%3Dno%2Cresizable%3Dyes%2Cscrollbars%3Dyes%2Cheight%3D600%2Cwidth%3D600%27+%29%3Breturn+false%3B%22+data-href%3D%22http%3A%2F%2Fwww.facebook.com%2Fdialog%2Fsend%3Fapp_id%3D891268654262273%26amp%3Bredirect_uri%3Dhttp%253A%252F%252Flocalhost%252Fwp%252Fhello-world%252F%26amp%3Blink%3Dhttp%253A%252F%252Flocalhost%252Fwp%252Fhello-world%252F%26amp%3Bdisplay%3Dpopup%22%3E%3Cspan+class%3D%22simplesocialtxt%22%3EMessenger%3C%2Fspan%3E%3C%2Fbutton%3E+%0A%3Cbutton+onclick%3D%22javascript%3Awindow.open%28this.dataset.href%2C+%27_blank%27+%29%3Breturn+false%3B%22+class%3D%22simplesocial-whatsapp-share%22+data-href%3D%22https%3A%2F%2Fapi.whatsapp.com%2Fsend%3Ftext%3Dhttp%3A%2F%2Flocalhost%2Fwp%2Fhello-world%2F%22%3E%3Cspan+class%3D%22simplesocialtxt%22%3EWhatsApp%3C%2Fspan%3E%3C%2Fbutton%3E%0A%3Cbutton+class%3D%22simplesocial-tumblr-share%22+data-href%3D%22http%3A%2F%2Ftumblr.com%2Fwidgets%2Fshare%2Ftool%3FcanonicalUrl%3Dhttp%253A%252F%252Flocalhost%252Fwp%252Fhello-world%252F%22+onclick%3D%22javascript%3Awindow.open%28this.dataset.href%2C+%27%27%2C+%27menubar%3Dno%2Ctoolbar%3Dno%2Cresizable%3Dyes%2Cscrollbars%3Dyes%2Cheight%3D600%2Cwidth%3D600%27%29%3Breturn+false%3B%22%3E%3Cspan+class%3D%22simplesocialtxt%22%3ETumblr%3C%2Fspan%3E+%3C%2Fbutton%3E%0A%3Cbutton+class%3D%22simplesocial-twt-share%22+data-href%3D%22https%3A%2F%2Ftwitter.com%2Fshare%3Ftext%3DHello%2Bworld%2521%26amp%3Burl%3Dhttp%3A%2F%2Flocalhost%2Fwp%2Fhello-world%2F%22+rel%3D%22nofollow%22+onclick%3D%22javascript%3Awindow.open%28this.dataset.href%2C+%27%27%2C+%27menubar%3Dno%2Ctoolbar%3Dno%2Cresizable%3Dyes%2Cscrollbars%3Dyes%2Cheight%3D600%2Cwidth%3D600%27%29%3Breturn+false%3B%22%3E%3Cspan+class%3D%22simplesocialtxt%22%3ETwitter%3C%2Fspan%3E+%3C%2Fbutton%3E%0A%3Cbutton+onclick%3D%22javascript%3Awindow.location.href+%3D+this.dataset.href%3Breturn+false%3B%22+class%3D%22simplesocial-email-share%22+data-href%3D%22mailto%3A%3Fsubject%3DHello%2Bworld%2521%26amp%3Bbody%3Dhttp%3A%2F%2Flocalhost%2Fwp%2Fhello-world%2F%22%3E%3Cspan+class%3D%22simplesocialtxt%22%3EEmail%3C%2Fspan%3E%3C%2Fbutton%3E%0A%3Cbutton+class%3D%22simplesocial-gplus-share%22+data-href%3D%22https%3A%2F%2Fplus.google.com%2Fshare%3Furl%3Dhttp%3A%2F%2Flocalhost%2Fwp%2Fhello-world%2F%22+onclick%3D%22javascript%3Awindow.open%28this.dataset.href%2C+%27%27%2C+%27menubar%3Dno%2Ctoolbar%3Dno%2Cresizable%3Dyes%2Cscrollbars%3Dyes%2Cheight%3D600%2Cwidth%3D600%27%29%3Breturn+false%3B%22%3E%3Cspan+class%3D%22simplesocialtxt%22%3EGoogle%2B%3C%2Fspan%3E%3C%2Fbutton%3E%0A%3Cbutton+target%3D%22popup%22+class%3D%22simplesocial-linkedin-share%22+data-href%3D%22https%3A%2F%2Fwww.linkedin.com%2Fcws%2Fshare%3Furl%3Dhttp%3A%2F%2Flocalhost%2Fwp%2Fhello-world%2F%22+onclick%3D%22javascript%3Awindow.open%28this.dataset.href%2C+%27%27%2C+%27menubar%3Dno%2Ctoolbar%3Dno%2Cresizable%3Dyes%2Cscrollbars%3Dyes%2Cheight%3D600%2Cwidth%3D600%27%29%3Breturn+false%3B%22%3E%3Cspan+class%3D%22simplesocialtxt%22%3ELinkedIn%3C%2Fspan%3E%3C%2Fbutton%3E%0A%3Cbutton+rel%3D%22nofollow%22+class%3D%22simplesocial-pinterest-share%22+onclick%3D%22var+e%3Ddocument.createElement%28%27script%27%29%3Be.setAttribute%28%27type%27%2C%27text%2Fjavascript%27%29%3Be.setAttribute%28%27charset%27%2C%27UTF-8%27%29%3Be.setAttribute%28%27src%27%2C%27%2F%2Fassets.pinterest.com%2Fjs%2Fpinmarklet.js%3Fr%3D%27%2BMath.random%28%29%2A99999999%29%3Bdocument.body.appendChild%28e%29%3Breturn+false%3B%22%3E%3Cspan+class%3D%22simplesocialtxt%22%3EPinterest%3C%2Fspan%3E%3C%2Fbutton%3E%0A%3Cbutton+class%3D%22simplesocial-reddit-share%22+data-href%3D%22https%3A%2F%2Freddit.com%2Fsubmit%3Furl%3Dhttp%3A%2F%2Flocalhost%2Fwp%2Fhello-world%2F%26amp%3Btitle%3DHello%2Bworld%2521%22+onclick%3D%22javascript%3Awindow.open%28this.dataset.href%2C+%27%27%2C+%27menubar%3Dno%2Ctoolbar%3Dno%2Cresizable%3Dyes%2Cscrollbars%3Dyes%2Cheight%3D600%2Cwidth%3D600%27%29%3Breturn+false%3B%22%3E%3Cspan+class%3D%22simplesocialtxt%22%3EReddit%3C%2Fspan%3E+%3C%2Fbutton%3E%0A%3C%2Fdiv%3E%0A%0A%3Cp%3EWel%26shy%3Bcome+to+Word%26shy%3BPress.%3Cbr%3E%0A%3Cimg+class%3D%22alignnone+size-medium+wp-image-8%22+src%3D%22http%3A%2F%2Flocalhost%2Fwp%2Fwp-content%2Fuploads%2F2018%2F07%2FDZV_1UkX4AEUlTZ-300x202.jpg%22+alt%3D%22%22+width%3D%22300%22+height%3D%22202%22+srcset%3D%22http%3A%2F%2Flocalhost%2Fwp%2Fwp-content%2Fuploads%2F2018%2F07%2FDZV_1UkX4AEUlTZ-300x202.jpg+300w%2C+http%3A%2F%2Flocalhost%2Fwp%2Fwp-content%2Fuploads%2F2018%2F07%2FDZV_1UkX4AEUlTZ-768x517.jpg+768w%2C+http%3A%2F%2Flocalhost%2Fwp%2Fwp-content%2Fuploads%2F2018%2F07%2FDZV_1UkX4AEUlTZ.jpg+789w%22+sizes%3D%22%28max-width%3A+300px%29+100vw%2C+300px%22%3E%3Cbr%3E%0AThis+is+your+first+post.+Edit+or+delete+it%2C+then+start+writ%26shy%3Bing%21%3C%2Fp%3E%0A%0A++++++++++++%3Ca+href%3D%22http%3A%2F%2Flocalhost%2Fwp%2Fhello-world%2F%22+class%3D%22more-link%22%3ERead+more%3C%2Fa%3E%0A%0A++++++++++++%3C%2Fdiv%3E'
   26     1        NEW                                              $5      'DOMDocument'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $5
   27     4        INIT_METHOD_CALL                                         !1, 'loadHTML'
          5        SEND_VAR_EX                                              !0
          6        SEND_VAL_EX                                              8196
          7        DO_FCALL                                      0          
   28     8        NEW                                              $9      'DOMXPath'
          9        SEND_VAR_EX                                              !1
         10        DO_FCALL                                      0          
         11        ASSIGN                                                   !2, $9
   30    12        INIT_METHOD_CALL                                         !2, 'query'
         13        SEND_VAL_EX                                              '%2F%2Fdiv%5Bcontains%28%40class%2C+%27simplesocialbuttons%27%29%5D'
         14        DO_FCALL                                      0  $12     
         15      > FE_RESET_R                                       $13     $12, ->22
         16    > > FE_FETCH_R                                               $13, !3, ->22
   31    17    >   FETCH_OBJ_R                                      ~14     !3, 'parentNode'
         18        INIT_METHOD_CALL                                         ~14, 'removeChild'
         19        SEND_VAR_EX                                              !3
         20        DO_FCALL                                      0          
   30    21      > JMP                                                      ->16
         22    >   FE_FREE                                                  $13
   33    23        INIT_METHOD_CALL                                         !1, 'saveHTML'
         24        DO_FCALL                                      0  $16     
         25        ECHO                                                     $16
         26      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
142.25 ms | 1008 KiB | 13 Q