3v4l.org

run code in 300+ PHP versions simultaneously
<?php $your_google_calendar="https://www.google.com/calendar/embed?showTitle=0&showPrint=0&showTabs=0&showCalendars=0&height=800&wkst=1&hl=pt_BR&bgcolor=%23FFFFFF&src=tprotegetreinamentos%40gmail.com&color=%23BE6D00&ctz=America%2FSao_Paulo"; $url= parse_url($your_google_calendar); $google_domain = $url['scheme'].'://'.$url['host'].dirname($url['path']).'/'; // Load and parse Google's raw calendar $dom = new DOMDocument; $dom->loadHTMLfile($your_google_calendar); // Change Google's CSS file to use absolute URLs (assumes there's only one element) //$css = $dom->getElementsByTagName('link')->item(0); $css = $dom->getElementsByTagName('link'); foreach ($css as $link) { $css_href = $link->getAttribute('href'); if ($css_href) $$link->setAttribute('href', $google_domain . $css_href); } //$css_href = $css->getAttribute('href'); //$css->setAttribute('href', $google_domain . $css_href); // Change Google's JS file to use absolute URLs $scripts = $dom->getElementsByTagName('script'); foreach ($scripts as $script) { $js_src = $script->getAttribute('src'); if ($js_src) $script->setAttribute('src', $google_domain . $js_src); } // Create a link to a new CSS file called custom_calendar.css $element = $dom->createElement('link'); $element->setAttribute('type', 'text/css'); $element->setAttribute('rel', 'stylesheet'); $element->setAttribute('href', 'custom_calendar.css'); // Append this link at the end of the element //DOMNodeList $head = $dom->getElementsByTagName('head'); // $head = $dom->getElementsByTagName('head')->item(0); echo($head); $head->appendChild($element); // Export the HTML //echo $dom->saveHTML(); ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 27, Position 2 = 40
Branch analysis from position: 27
2 jumps found. (Code = 78) Position 1 = 28, Position 2 = 40
Branch analysis from position: 28
2 jumps found. (Code = 43) Position 1 = 33, Position 2 = 39
Branch analysis from position: 33
1 jumps found. (Code = 42) Position 1 = 27
Branch analysis from position: 27
Branch analysis from position: 39
Branch analysis from position: 40
2 jumps found. (Code = 77) Position 1 = 46, Position 2 = 58
Branch analysis from position: 46
2 jumps found. (Code = 78) Position 1 = 47, Position 2 = 58
Branch analysis from position: 47
2 jumps found. (Code = 43) Position 1 = 52, Position 2 = 57
Branch analysis from position: 52
1 jumps found. (Code = 42) Position 1 = 46
Branch analysis from position: 46
Branch analysis from position: 57
Branch analysis from position: 58
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 58
Branch analysis from position: 40
filename:       /in/ESghh
function name:  (null)
number of ops:  91
compiled vars:  !0 = $your_google_calendar, !1 = $url, !2 = $google_domain, !3 = $dom, !4 = $css, !5 = $link, !6 = $css_href, !7 = $scripts, !8 = $script, !9 = $js_src, !10 = $element, !11 = $head
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'https%3A%2F%2Fwww.google.com%2Fcalendar%2Fembed%3FshowTitle%3D0%26showPrint%3D0%26showTabs%3D0%26showCalendars%3D0%26height%3D800%26wkst%3D1%26hl%3Dpt_BR%26bgcolor%3D%2523FFFFFF%26src%3Dtprotegetreinamentos%2540gmail.com%26color%3D%2523BE6D00%26ctz%3DAmerica%252FSao_Paulo'
    3     1        INIT_FCALL                                               'parse_url'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $13     
          4        ASSIGN                                                   !1, $13
    4     5        FETCH_DIM_R                                      ~15     !1, 'scheme'
          6        CONCAT                                           ~16     ~15, '%3A%2F%2F'
          7        FETCH_DIM_R                                      ~17     !1, 'host'
          8        CONCAT                                           ~18     ~16, ~17
          9        INIT_FCALL                                               'dirname'
         10        FETCH_DIM_R                                      ~19     !1, 'path'
         11        SEND_VAL                                                 ~19
         12        DO_ICALL                                         $20     
         13        CONCAT                                           ~21     ~18, $20
         14        CONCAT                                           ~22     ~21, '%2F'
         15        ASSIGN                                                   !2, ~22
    6    16        NEW                                              $24     'DOMDocument'
         17        DO_FCALL                                      0          
         18        ASSIGN                                                   !3, $24
    7    19        INIT_METHOD_CALL                                         !3, 'loadHTMLfile'
         20        SEND_VAR_EX                                              !0
         21        DO_FCALL                                      0          
   10    22        INIT_METHOD_CALL                                         !3, 'getElementsByTagName'
         23        SEND_VAL_EX                                              'link'
         24        DO_FCALL                                      0  $28     
         25        ASSIGN                                                   !4, $28
   11    26      > FE_RESET_R                                       $30     !4, ->40
         27    > > FE_FETCH_R                                               $30, !5, ->40
   12    28    >   INIT_METHOD_CALL                                         !5, 'getAttribute'
         29        SEND_VAL_EX                                              'href'
         30        DO_FCALL                                      0  $31     
         31        ASSIGN                                                   !6, $31
   13    32      > JMPZ                                                     !6, ->39
         33    >   FETCH_R                      local               ~33     !5
         34        INIT_METHOD_CALL                                         ~33, 'setAttribute'
         35        SEND_VAL_EX                                              'href'
         36        CONCAT                                           ~34     !2, !6
         37        SEND_VAL_EX                                              ~34
         38        DO_FCALL                                      0          
   11    39    > > JMP                                                      ->27
         40    >   FE_FREE                                                  $30
   18    41        INIT_METHOD_CALL                                         !3, 'getElementsByTagName'
         42        SEND_VAL_EX                                              'script'
         43        DO_FCALL                                      0  $36     
         44        ASSIGN                                                   !7, $36
   19    45      > FE_RESET_R                                       $38     !7, ->58
         46    > > FE_FETCH_R                                               $38, !8, ->58
   20    47    >   INIT_METHOD_CALL                                         !8, 'getAttribute'
         48        SEND_VAL_EX                                              'src'
         49        DO_FCALL                                      0  $39     
         50        ASSIGN                                                   !9, $39
   21    51      > JMPZ                                                     !9, ->57
         52    >   INIT_METHOD_CALL                                         !8, 'setAttribute'
         53        SEND_VAL_EX                                              'src'
         54        CONCAT                                           ~41     !2, !9
         55        SEND_VAL_EX                                              ~41
         56        DO_FCALL                                      0          
   19    57    > > JMP                                                      ->46
         58    >   FE_FREE                                                  $38
   24    59        INIT_METHOD_CALL                                         !3, 'createElement'
         60        SEND_VAL_EX                                              'link'
         61        DO_FCALL                                      0  $43     
         62        ASSIGN                                                   !10, $43
   25    63        INIT_METHOD_CALL                                         !10, 'setAttribute'
         64        SEND_VAL_EX                                              'type'
         65        SEND_VAL_EX                                              'text%2Fcss'
         66        DO_FCALL                                      0          
   26    67        INIT_METHOD_CALL                                         !10, 'setAttribute'
         68        SEND_VAL_EX                                              'rel'
         69        SEND_VAL_EX                                              'stylesheet'
         70        DO_FCALL                                      0          
   27    71        INIT_METHOD_CALL                                         !10, 'setAttribute'
         72        SEND_VAL_EX                                              'href'
         73        SEND_VAL_EX                                              'custom_calendar.css'
         74        DO_FCALL                                      0          
   30    75        INIT_METHOD_CALL                                         !3, 'getElementsByTagName'
         76        SEND_VAL_EX                                              'head'
         77        DO_FCALL                                      0  $48     
         78        ASSIGN                                                   !11, $48
   32    79        INIT_METHOD_CALL                                         !3, 'getElementsByTagName'
         80        SEND_VAL_EX                                              'head'
         81        DO_FCALL                                      0  $50     
         82        INIT_METHOD_CALL                                         $50, 'item'
         83        SEND_VAL_EX                                              0
         84        DO_FCALL                                      0  $51     
         85        ASSIGN                                                   !11, $51
   33    86        ECHO                                                     !11
   34    87        INIT_METHOD_CALL                                         !11, 'appendChild'
         88        SEND_VAR_EX                                              !10
         89        DO_FCALL                                      0          
   37    90      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.51 ms | 1404 KiB | 17 Q