3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = 'cualquiercosa<b>contenido</b>cualquiercosa'; //Generar el DOM $dom = new DOMDocument; $dom->loadHTML($html, LIBXML_COMPACT | LIBXML_HTML_NOIMPLIED | LIBXML_NONET); //Obtener todos los tags <B> $b_nodelist = $dom->getElementsByTagName('b'); //Bucle para cada <b> foreach ($b_nodelist as $b) { //Obtener el contenido de texto del tag $texto = $b->textContent; echo "\n\nContenido del B:\n" . $texto; // => contenido }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 13, Position 2 = 19
Branch analysis from position: 13
2 jumps found. (Code = 78) Position 1 = 14, Position 2 = 19
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
filename:       /in/ZZVPd
function name:  (null)
number of ops:  21
compiled vars:  !0 = $html, !1 = $dom, !2 = $b_nodelist, !3 = $b, !4 = $texto
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'cualquiercosa%3Cb%3Econtenido%3C%2Fb%3Ecualquiercosa'
    6     1        NEW                                              $6      'DOMDocument'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $6
    7     4        INIT_METHOD_CALL                                         !1, 'loadHTML'
          5        SEND_VAR_EX                                              !0
          6        SEND_VAL_EX                                              75776
          7        DO_FCALL                                      0          
   11     8        INIT_METHOD_CALL                                         !1, 'getElementsByTagName'
          9        SEND_VAL_EX                                              'b'
         10        DO_FCALL                                      0  $10     
         11        ASSIGN                                                   !2, $10
   14    12      > FE_RESET_R                                       $12     !2, ->19
         13    > > FE_FETCH_R                                               $12, !3, ->19
   17    14    >   FETCH_OBJ_R                                      ~13     !3, 'textContent'
         15        ASSIGN                                                   !4, ~13
   19    16        CONCAT                                           ~15     '%0A%0AContenido+del+B%3A%0A', !4
         17        ECHO                                                     ~15
   14    18      > JMP                                                      ->13
         19    >   FE_FREE                                                  $12
   20    20      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
140.99 ms | 997 KiB | 13 Q