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 as $k => $v) echo "$k => $v<br />"; ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 13, Position 2 = 21
Branch analysis from position: 13
2 jumps found. (Code = 78) Position 1 = 14, Position 2 = 21
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
filename:       /in/mYRvM
function name:  (null)
number of ops:  23
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      > FE_RESET_R                                       $12     !2, ->21
         13    > > FE_FETCH_R                                       ~13     $12, !3, ->21
         14    >   ASSIGN                                                   !4, ~13
   27    15        ROPE_INIT                                     4  ~16     !4
         16        ROPE_ADD                                      1  ~16     ~16, '+%3D%3E+'
         17        ROPE_ADD                                      2  ~16     ~16, !3
         18        ROPE_END                                      3  ~15     ~16, '%3Cbr+%2F%3E'
         19        ECHO                                                     ~15
   26    20      > JMP                                                      ->13
         21    >   FE_FREE                                                  $12
   29    22      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
176.98 ms | 1396 KiB | 15 Q