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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
141.78 ms | 1396 KiB | 15 Q