3v4l.org

run code in 300+ PHP versions simultaneously
<?php $x="<root> <person> <name>Julie</name> <age>37</age> <rating>5</rating> </person> <person> <name>Greta</name> <age>56</age> <rating>7</rating> </person> <person> <name>Kerstin</name> <age>38</age> <rating>10</rating> </person> </root>"; $xml = simplexml_load_string($x); $person = $xml->xpath("//person[name='Greta']"); echo $person[0]['age']; foreach ($person[0] as $k => $v) echo "$k => $v<br />"; ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 14, Position 2 = 22
Branch analysis from position: 14
2 jumps found. (Code = 78) Position 1 = 15, Position 2 = 22
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
filename:       /in/e8XeN
function name:  (null)
number of ops:  24
compiled vars:  !0 = $x, !1 = $xml, !2 = $person, !3 = $v, !4 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%3Croot%3E%0A%3Cperson%3E%0A%09%3Cname%3EJulie%3C%2Fname%3E%0A%09%3Cage%3E37%3C%2Fage%3E%09%0A%09%3Crating%3E5%3C%2Frating%3E%0A%3C%2Fperson%3E%0A%3Cperson%3E%0A%09%3Cname%3EGreta%3C%2Fname%3E%0A%09%3Cage%3E56%3C%2Fage%3E%0A%09%3Crating%3E7%3C%2Frating%3E%0A%3C%2Fperson%3E%0A%3Cperson%3E%0A%09%3Cname%3EKerstin%3C%2Fname%3E%0A%09%3Cage%3E38%3C%2Fage%3E%0A%09%3Crating%3E10%3C%2Frating%3E%0A%3C%2Fperson%3E%09%0A%3C%2Froot%3E'
   20     1        INIT_FCALL                                               'simplexml_load_string'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $6      
          4        ASSIGN                                                   !1, $6
   22     5        INIT_METHOD_CALL                                         !1, 'xpath'
          6        SEND_VAL_EX                                              '%2F%2Fperson%5Bname%3D%27Greta%27%5D'
          7        DO_FCALL                                      0  $8      
          8        ASSIGN                                                   !2, $8
   24     9        FETCH_DIM_R                                      ~10     !2, 0
         10        FETCH_DIM_R                                      ~11     ~10, 'age'
         11        ECHO                                                     ~11
   26    12        FETCH_DIM_R                                      ~12     !2, 0
         13      > FE_RESET_R                                       $13     ~12, ->22
         14    > > FE_FETCH_R                                       ~14     $13, !3, ->22
         15    >   ASSIGN                                                   !4, ~14
   27    16        ROPE_INIT                                     4  ~17     !4
         17        ROPE_ADD                                      1  ~17     ~17, '+%3D%3E+'
         18        ROPE_ADD                                      2  ~17     ~17, !3
         19        ROPE_END                                      3  ~16     ~17, '%3Cbr+%2F%3E'
         20        ECHO                                                     ~16
   26    21      > JMP                                                      ->14
         22    >   FE_FREE                                                  $13
   29    23      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.65 ms | 1396 KiB | 15 Q