3v4l.org

run code in 500+ PHP versions simultaneously
<?php $html = '<drupal-render-placeholder callback="poll.post_render_cache:renderViewForm" arguments="id=1&view_mode=np8_sidebar" token="e450a32c"></drupal-render-placeholder>'; $document = <<<EOD <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head> <body>!html</body> </html> EOD; // PHP's \DOMDocument serialization adds extra whitespace when the markup // of the wrapping document contains newlines, so ensure we remove all // newlines before injecting the actual HTML body to be processed. $document = strtr($document, array("\n" => '', '!html' => $html)); $dom = new \DOMDocument(); // Ignore warnings during HTML soup loading. @$dom->loadHTML($document); $element = $dom->getElementsByTagName('body')->item(0); echo $element->ownerDocument->saveXML($element);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GGWCn
function name:  (null)
number of ops:  27
compiled vars:  !0 = $html, !1 = $document, !2 = $dom, !3 = $element
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, '%3Cdrupal-render-placeholder+callback%3D%22poll.post_render_cache%3ArenderViewForm%22+arguments%3D%22id%3D1%26view_mode%3Dnp8_sidebar%22+token%3D%22e450a32c%22%3E%3C%2Fdrupal-render-placeholder%3E'
    4     1        ASSIGN                                                       !1, '%3C%21DOCTYPE+html+PUBLIC+%22-%2F%2FW3C%2F%2FDTD+XHTML+1.0+Strict%2F%2FEN%22+%22http%3A%2F%2Fwww.w3.org%2FTR%2Fxhtml1%2FDTD%2Fxhtml1-strict.dtd%22%3E%0A%3Chtml+xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%22%3E%0A%3Chead%3E%3Cmeta+http-equiv%3D%22Content-Type%22+content%3D%22text%2Fhtml%3B+charset%3Dutf-8%22+%2F%3E%3C%2Fhead%3E%0A%3Cbody%3E%21html%3C%2Fbody%3E%0A%3C%2Fhtml%3E'
   14     2        INIT_ARRAY                                           ~6      '', '%0A'
          3        ADD_ARRAY_ELEMENT                                    ~6      !0, '%21html'
          4        FRAMELESS_ICALL_2                strtr               ~7      !1, ~6
          5        ASSIGN                                                       !1, ~7
   16     6        NEW                                                  $9      'DOMDocument'
          7        DO_FCALL                                          0          
          8        ASSIGN                                                       !2, $9
   18     9        BEGIN_SILENCE                                        ~12     
         10        INIT_METHOD_CALL                                             !2, 'loadHTML'
         11        SEND_VAR_EX                                                  !1
         12        DO_FCALL                                          0          
         13        END_SILENCE                                                  ~12
   19    14        INIT_METHOD_CALL                                             !2, 'getElementsByTagName'
         15        SEND_VAL_EX                                                  'body'
         16        DO_FCALL                                          0  $14     
         17        INIT_METHOD_CALL                                             $14, 'item'
         18        SEND_VAL_EX                                                  0
         19        DO_FCALL                                          0  $15     
         20        ASSIGN                                                       !3, $15
   20    21        FETCH_OBJ_R                                          ~17     !3, 'ownerDocument'
         22        INIT_METHOD_CALL                                             ~17, 'saveXML'
         23        SEND_VAR_EX                                                  !3
         24        DO_FCALL                                          0  $18     
         25        ECHO                                                         $18
         26      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
224.69 ms | 2235 KiB | 8 Q