3v4l.org

run code in 300+ PHP versions simultaneously
<?php $file_contents = '<p>Involontairement au d&eacute;part, plus ou moins volontairement maintenant</p><p>Je l\'ai pris involontairement (je dirais m&ecirc;me que c\'est les anciens "amis" qui m\'y on emmen&eacute;).<br /> Mais finalement la solitude me pla&icirc;t. J\'ai l\'impression que c\'est fait pour moi.</p>'; $dom = new DOMDocument; $dom->loadHTML($file_contents); $result = []; foreach ($dom->getElementsByTagName('p') as $pNode) { $content = ''; foreach ($pNode->childNodes as $childNode) { $content .= $dom->saveHTML($childNode); } $result[] = $content; } var_dump($result);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 12, Position 2 = 26
Branch analysis from position: 12
2 jumps found. (Code = 78) Position 1 = 13, Position 2 = 26
Branch analysis from position: 13
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 = 42) Position 1 = 12
Branch analysis from position: 12
Branch analysis from position: 22
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 26
filename:       /in/L16ga
function name:  (null)
number of ops:  31
compiled vars:  !0 = $file_contents, !1 = $dom, !2 = $result, !3 = $pNode, !4 = $content, !5 = $childNode
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%3Cp%3EInvolontairement+au+d%26eacute%3Bpart%2C+plus+ou+moins+volontairement+maintenant%3C%2Fp%3E%3Cp%3EJe+l%27ai+pris+involontairement+%28je+dirais+m%26ecirc%3Bme+que+c%27est+les+anciens+%22amis%22+qui+m%27y+on+emmen%26eacute%3B%29.%3Cbr+%2F%3E%0AMais+finalement+la+solitude+me+pla%26icirc%3Bt.+J%27ai+l%27impression+que+c%27est+fait+pour+moi.%3C%2Fp%3E'
    5     1        NEW                                              $7      'DOMDocument'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $7
    6     4        INIT_METHOD_CALL                                         !1, 'loadHTML'
          5        SEND_VAR_EX                                              !0
          6        DO_FCALL                                      0          
    8     7        ASSIGN                                                   !2, <array>
   10     8        INIT_METHOD_CALL                                         !1, 'getElementsByTagName'
          9        SEND_VAL_EX                                              'p'
         10        DO_FCALL                                      0  $12     
         11      > FE_RESET_R                                       $13     $12, ->26
         12    > > FE_FETCH_R                                               $13, !3, ->26
   11    13    >   ASSIGN                                                   !4, ''
   12    14        FETCH_OBJ_R                                      ~15     !3, 'childNodes'
         15      > FE_RESET_R                                       $16     ~15, ->22
         16    > > FE_FETCH_R                                               $16, !5, ->22
   13    17    >   INIT_METHOD_CALL                                         !1, 'saveHTML'
         18        SEND_VAR_EX                                              !5
         19        DO_FCALL                                      0  $17     
         20        ASSIGN_OP                                     8          !4, $17
   12    21      > JMP                                                      ->16
         22    >   FE_FREE                                                  $16
   15    23        ASSIGN_DIM                                               !2
         24        OP_DATA                                                  !4
   10    25      > JMP                                                      ->12
         26    >   FE_FREE                                                  $13
   18    27        INIT_FCALL                                               'var_dump'
         28        SEND_VAR                                                 !2
         29        DO_ICALL                                                 
         30      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
136.76 ms | 1001 KiB | 14 Q