3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text='<p class="users_attr" style=""></p> <h3 class="show_user_h3" style=""><a href="/ru/tutors/violin/" class="link_users_attr">Игра на скрипке, виолончели</a></h3> , <h3 class="show_user_h3" style=""><a href="/ru/tutors/hrafika-1/" class="link_users_attr">Искусствоведение</a></h3> , <h3 class="show_user_h3" style=""><a href="/ru/tutors/uroki-vokala/" class="link_users_attr">Уроки вокала</a></h3> , <h3 class="show_user_h3" style=""><a href="/ru/tutors/hra-na-fortepano/" class="link_users_attr">Игра на фортепиано</a></h3> , <h3 class="show_user_h3" style=""><a href="/ru/tutors/sopilka/" class="link_users_attr">Игра на флейте</a></h3> , <h3 class="show_user_h3" style=""><a href="/ru/tutors/muzika/" class="link_users_attr">Музыка</a></h3> , <h3 class="show_user_h3" style=""><a href="/ru/tutors/psykholohiia/" class="link_users_attr">Психология</a></h3> <p style=""></p>'; $dom=new DOMDocument; $dom->loadHTML('<?xml encoding="utf-8" ?>' . $text); // https://stackoverflow.com/a/8218649/2943403 $xpath = new DOMXPath($dom); $data['cats'] = []; foreach ($xpath->query("//a") as $node) { $data['cats'][] = $node->nodeValue; } echo implode('; ', $data['cats']);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 18, Position 2 = 24
Branch analysis from position: 18
2 jumps found. (Code = 78) Position 1 = 19, Position 2 = 24
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 24
filename:       /in/GJ5gc
function name:  (null)
number of ops:  32
compiled vars:  !0 = $text, !1 = $dom, !2 = $xpath, !3 = $data, !4 = $node
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%3Cp+class%3D%22users_attr%22+style%3D%22%22%3E%3C%2Fp%3E%0A++++%3Ch3+class%3D%22show_user_h3%22+style%3D%22%22%3E%3Ca+href%3D%22%2Fru%2Ftutors%2Fviolin%2F%22+class%3D%22link_users_attr%22%3E%D0%98%D0%B3%D1%80%D0%B0+%D0%BD%D0%B0+%D1%81%D0%BA%D1%80%D0%B8%D0%BF%D0%BA%D0%B5%2C+%D0%B2%D0%B8%D0%BE%D0%BB%D0%BE%D0%BD%D1%87%D0%B5%D0%BB%D0%B8%3C%2Fa%3E%3C%2Fh3%3E%0A++++%2C+%0A++++%3Ch3+class%3D%22show_user_h3%22+style%3D%22%22%3E%3Ca+href%3D%22%2Fru%2Ftutors%2Fhrafika-1%2F%22+class%3D%22link_users_attr%22%3E%D0%98%D1%81%D0%BA%D1%83%D1%81%D1%81%D1%82%D0%B2%D0%BE%D0%B2%D0%B5%D0%B4%D0%B5%D0%BD%D0%B8%D0%B5%3C%2Fa%3E%3C%2Fh3%3E%0A++++%2C+%0A++++%3Ch3+class%3D%22show_user_h3%22+style%3D%22%22%3E%3Ca+href%3D%22%2Fru%2Ftutors%2Furoki-vokala%2F%22+class%3D%22link_users_attr%22%3E%D0%A3%D1%80%D0%BE%D0%BA%D0%B8+%D0%B2%D0%BE%D0%BA%D0%B0%D0%BB%D0%B0%3C%2Fa%3E%3C%2Fh3%3E%0A++++%2C+%0A++++%3Ch3+class%3D%22show_user_h3%22+style%3D%22%22%3E%3Ca+href%3D%22%2Fru%2Ftutors%2Fhra-na-fortepano%2F%22+class%3D%22link_users_attr%22%3E%D0%98%D0%B3%D1%80%D0%B0+%D0%BD%D0%B0+%D1%84%D0%BE%D1%80%D1%82%D0%B5%D0%BF%D0%B8%D0%B0%D0%BD%D0%BE%3C%2Fa%3E%3C%2Fh3%3E%0A++++%2C+%0A++++%3Ch3+class%3D%22show_user_h3%22+style%3D%22%22%3E%3Ca+href%3D%22%2Fru%2Ftutors%2Fsopilka%2F%22+class%3D%22link_users_attr%22%3E%D0%98%D0%B3%D1%80%D0%B0+%D0%BD%D0%B0+%D1%84%D0%BB%D0%B5%D0%B9%D1%82%D0%B5%3C%2Fa%3E%3C%2Fh3%3E%0A++++%2C+%0A++++%3Ch3+class%3D%22show_user_h3%22+style%3D%22%22%3E%3Ca+href%3D%22%2Fru%2Ftutors%2Fmuzika%2F%22+class%3D%22link_users_attr%22%3E%D0%9C%D1%83%D0%B7%D1%8B%D0%BA%D0%B0%3C%2Fa%3E%3C%2Fh3%3E%0A++++%2C+%0A++++%3Ch3+class%3D%22show_user_h3%22+style%3D%22%22%3E%3Ca+href%3D%22%2Fru%2Ftutors%2Fpsykholohiia%2F%22+class%3D%22link_users_attr%22%3E%D0%9F%D1%81%D0%B8%D1%85%D0%BE%D0%BB%D0%BE%D0%B3%D0%B8%D1%8F%3C%2Fa%3E%3C%2Fh3%3E%0A++++%3Cp+style%3D%22%22%3E%3C%2Fp%3E'
   18     1        NEW                                              $6      'DOMDocument'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $6
   19     4        INIT_METHOD_CALL                                         !1, 'loadHTML'
          5        CONCAT                                           ~9      '%3C%3Fxml+encoding%3D%22utf-8%22+%3F%3E', !0
          6        SEND_VAL_EX                                              ~9
          7        DO_FCALL                                      0          
   20     8        NEW                                              $11     'DOMXPath'
          9        SEND_VAR_EX                                              !1
         10        DO_FCALL                                      0          
         11        ASSIGN                                                   !2, $11
   22    12        ASSIGN_DIM                                               !3, 'cats'
         13        OP_DATA                                                  <array>
   23    14        INIT_METHOD_CALL                                         !2, 'query'
         15        SEND_VAL_EX                                              '%2F%2Fa'
         16        DO_FCALL                                      0  $15     
         17      > FE_RESET_R                                       $16     $15, ->24
         18    > > FE_FETCH_R                                               $16, !4, ->24
   24    19    >   FETCH_OBJ_R                                      ~19     !4, 'nodeValue'
         20        FETCH_DIM_W                                      $17     !3, 'cats'
         21        ASSIGN_DIM                                               $17
         22        OP_DATA                                                  ~19
   23    23      > JMP                                                      ->18
         24    >   FE_FREE                                                  $16
   26    25        INIT_FCALL                                               'implode'
         26        SEND_VAL                                                 '%3B+'
         27        FETCH_DIM_R                                      ~20     !3, 'cats'
         28        SEND_VAL                                                 ~20
         29        DO_ICALL                                         $21     
         30        ECHO                                                     $21
         31      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
141.5 ms | 1405 KiB | 15 Q