3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml=simplexml_load_string(<<<XML <feed> <entry> <id>1980475</id> <link rel="post" href="http://..."></link> <link rel="edit" href="http://..."></link> <link rel="alternate" href="http://..."></link> </entry> <entry> <id>1980476</id> <link rel="post" href="http://..."></link> <link rel="edit" href="http://..."></link> <link rel="alternate" href="http://..."> <lo> naiya </lo> <lo> naiya </lo> </link> </entry> </feed> XML ); echo count($xml->xpath('//link[@rel="alternate"]')); $node = $xml->xpath('//link[@rel="alternate"]'); foreach ($node->children() as $f){ echo $f; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 16, Position 2 = 19
Branch analysis from position: 16
2 jumps found. (Code = 78) Position 1 = 17, Position 2 = 19
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
filename:       /in/R9NqP
function name:  (null)
number of ops:  21
compiled vars:  !0 = $xml, !1 = $node, !2 = $f
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'simplexml_load_string'
    3     1        SEND_VAL                                                 '%3Cfeed%3E%0A++++%3Centry%3E%0A++++++++%3Cid%3E1980475%3C%2Fid%3E%0A++++++++%3Clink+rel%3D%22post%22+href%3D%22http%3A%2F%2F...%22%3E%3C%2Flink%3E%0A++++++++%3Clink+rel%3D%22edit%22+href%3D%22http%3A%2F%2F...%22%3E%3C%2Flink%3E%0A++++++++%3Clink+rel%3D%22alternate%22+href%3D%22http%3A%2F%2F...%22%3E%3C%2Flink%3E%0A++++%3C%2Fentry%3E%0A++++%3Centry%3E%0A++++++++%3Cid%3E1980476%3C%2Fid%3E%0A++++++++%3Clink+rel%3D%22post%22+href%3D%22http%3A%2F%2F...%22%3E%3C%2Flink%3E%0A++++++++%3Clink+rel%3D%22edit%22+href%3D%22http%3A%2F%2F...%22%3E%3C%2Flink%3E%0A++++++++%3Clink+rel%3D%22alternate%22+href%3D%22http%3A%2F%2F...%22%3E%0A++++++++%3Clo%3E++naiya+%3C%2Flo%3E++%0A++++++++%3Clo%3E++naiya+%3C%2Flo%3E++++++%0A++++++++%3C%2Flink%3E%0A++++%3C%2Fentry%3E%0A%3C%2Ffeed%3E'
          2        DO_ICALL                                         $3      
    2     3        ASSIGN                                                   !0, $3
   22     4        INIT_METHOD_CALL                                         !0, 'xpath'
          5        SEND_VAL_EX                                              '%2F%2Flink%5B%40rel%3D%22alternate%22%5D'
          6        DO_FCALL                                      0  $5      
          7        COUNT                                            ~6      $5
          8        ECHO                                                     ~6
   23     9        INIT_METHOD_CALL                                         !0, 'xpath'
         10        SEND_VAL_EX                                              '%2F%2Flink%5B%40rel%3D%22alternate%22%5D'
         11        DO_FCALL                                      0  $7      
         12        ASSIGN                                                   !1, $7
   25    13        INIT_METHOD_CALL                                         !1, 'children'
         14        DO_FCALL                                      0  $9      
         15      > FE_RESET_R                                       $10     $9, ->19
         16    > > FE_FETCH_R                                               $10, !2, ->19
   26    17    >   ECHO                                                     !2
   25    18      > JMP                                                      ->16
         19    >   FE_FREE                                                  $10
   27    20      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.16 ms | 1396 KiB | 15 Q