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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.03 ms | 1396 KiB | 15 Q