3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = <<< ST <h1 class="text-align-center" style="font-size:22px;margin-top:0px;margin-bottom:0px;color:rgb(0,0,0);font-family:IntroBold, sans-serif;line-height:1.5;letter-spacing:0px;font-weight:700;text-align:center;">You should be&nbsp;confident solving wicked problems in a hybrid role between strategy, research, design and business&nbsp;through a discovery driven approach.&nbsp;</h1><p></p><h2 style="margin-top:0px;margin-bottom:.5em;font-family:IntroBold, sans-serif;font-size:19px;line-height:1em;text-transform:uppercase;letter-spacing:1px;font-weight:700;"><strong>KEY RESPONSIBILITIES</strong></h2> ST; $dom = new domdocument(); $dom->loadHTML($html, LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD); $xpath = new domxpath($dom); $headings = $xpath->query("//h1 | //h2 | //h3 | //h4 | //h5 | //h6"); foreach ($headings as $h) { $s = $dom->createElement("strong", $h->nodeValue); $h->parentNode->replaceChild($s, $h); } echo $dom->saveHTML();
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 17, Position 2 = 31
Branch analysis from position: 17
2 jumps found. (Code = 78) Position 1 = 18, Position 2 = 31
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
Branch analysis from position: 31
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 31
filename:       /in/r7jIP
function name:  (null)
number of ops:  36
compiled vars:  !0 = $html, !1 = $dom, !2 = $xpath, !3 = $headings, !4 = $h, !5 = $s
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%3Ch1+class%3D%22text-align-center%22+style%3D%22font-size%3A22px%3Bmargin-top%3A0px%3Bmargin-bottom%3A0px%3Bcolor%3Argb%280%2C0%2C0%29%3Bfont-family%3AIntroBold%2C+sans-serif%3Bline-height%3A1.5%3Bletter-spacing%3A0px%3Bfont-weight%3A700%3Btext-align%3Acenter%3B%22%3EYou+should+be%26nbsp%3Bconfident+solving+wicked+problems+in+a+hybrid+role+between+strategy%2C+research%2C+design+and+business%26nbsp%3Bthrough+a+discovery+driven+approach.%26nbsp%3B%3C%2Fh1%3E%3Cp%3E%3C%2Fp%3E%3Ch2+style%3D%22margin-top%3A0px%3Bmargin-bottom%3A.5em%3Bfont-family%3AIntroBold%2C+sans-serif%3Bfont-size%3A19px%3Bline-height%3A1em%3Btext-transform%3Auppercase%3Bletter-spacing%3A1px%3Bfont-weight%3A700%3B%22%3E%3Cstrong%3EKEY+RESPONSIBILITIES%3C%2Fstrong%3E%3C%2Fh2%3E'
    8     1        NEW                                              $7      'domdocument'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $7
    9     4        INIT_METHOD_CALL                                         !1, 'loadHTML'
          5        SEND_VAR_EX                                              !0
          6        SEND_VAL_EX                                              8196
          7        DO_FCALL                                      0          
   10     8        NEW                                              $11     'domxpath'
          9        SEND_VAR_EX                                              !1
         10        DO_FCALL                                      0          
         11        ASSIGN                                                   !2, $11
   11    12        INIT_METHOD_CALL                                         !2, 'query'
         13        SEND_VAL_EX                                              '%2F%2Fh1+%7C+%2F%2Fh2+%7C+%2F%2Fh3+%7C+%2F%2Fh4+%7C+%2F%2Fh5+%7C+%2F%2Fh6'
         14        DO_FCALL                                      0  $14     
         15        ASSIGN                                                   !3, $14
   12    16      > FE_RESET_R                                       $16     !3, ->31
         17    > > FE_FETCH_R                                               $16, !4, ->31
   13    18    >   INIT_METHOD_CALL                                         !1, 'createElement'
         19        SEND_VAL_EX                                              'strong'
         20        CHECK_FUNC_ARG                                           
         21        FETCH_OBJ_FUNC_ARG                               $17     !4, 'nodeValue'
         22        SEND_FUNC_ARG                                            $17
         23        DO_FCALL                                      0  $18     
         24        ASSIGN                                                   !5, $18
   14    25        FETCH_OBJ_R                                      ~20     !4, 'parentNode'
         26        INIT_METHOD_CALL                                         ~20, 'replaceChild'
         27        SEND_VAR_EX                                              !5
         28        SEND_VAR_EX                                              !4
         29        DO_FCALL                                      0          
   12    30      > JMP                                                      ->17
         31    >   FE_FREE                                                  $16
   16    32        INIT_METHOD_CALL                                         !1, 'saveHTML'
         33        DO_FCALL                                      0  $22     
         34        ECHO                                                     $22
         35      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
125.85 ms | 1012 KiB | 13 Q