3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xmlstr = '<?xml version="1.0" encoding="utf-8"?> <root total="450" count="4" start="0"> <Code>0</Code> <Item><Person.P_Id>14845</Person.P_Id></Item> <Item><Person.P_Id>14844</Person.P_Id></Item> <Item><Person.P_Id>14837</Person.P_Id></Item> <Item><Person.P_Id>14836</Person.P_Id></Item> </root>'; $xml = simplexml_load_string($xmlstr); $itemobjs = $xml->xpath('//Item'); print_r($itemobjs); $items = array_map(function ($v) { return (string)$v->{'Person.P_Id'}; }, $itemobjs); print_r($items);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/uelbR
function name:  (null)
number of ops:  22
compiled vars:  !0 = $xmlstr, !1 = $xml, !2 = $itemobjs, !3 = $items
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%3C%3Fxml+version%3D%221.0%22+encoding%3D%22utf-8%22%3F%3E%0A%3Croot+total%3D%22450%22+count%3D%224%22+start%3D%220%22%3E%0A%3CCode%3E0%3C%2FCode%3E%0A%3CItem%3E%3CPerson.P_Id%3E14845%3C%2FPerson.P_Id%3E%3C%2FItem%3E%0A%3CItem%3E%3CPerson.P_Id%3E14844%3C%2FPerson.P_Id%3E%3C%2FItem%3E%0A%3CItem%3E%3CPerson.P_Id%3E14837%3C%2FPerson.P_Id%3E%3C%2FItem%3E%0A%3CItem%3E%3CPerson.P_Id%3E14836%3C%2FPerson.P_Id%3E%3C%2FItem%3E%0A%3C%2Froot%3E'
   12     1        INIT_FCALL                                               'simplexml_load_string'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $5      
          4        ASSIGN                                                   !1, $5
   13     5        INIT_METHOD_CALL                                         !1, 'xpath'
          6        SEND_VAL_EX                                              '%2F%2FItem'
          7        DO_FCALL                                      0  $7      
          8        ASSIGN                                                   !2, $7
   14     9        INIT_FCALL                                               'print_r'
         10        SEND_VAR                                                 !2
         11        DO_ICALL                                                 
   15    12        INIT_FCALL                                               'array_map'
         13        DECLARE_LAMBDA_FUNCTION                          ~10     [0]
         14        SEND_VAL                                                 ~10
         15        SEND_VAR                                                 !2
         16        DO_ICALL                                         $11     
         17        ASSIGN                                                   !3, $11
   16    18        INIT_FCALL                                               'print_r'
         19        SEND_VAR                                                 !3
         20        DO_ICALL                                                 
         21      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/uelbR
function name:  {closure}
number of ops:  5
compiled vars:  !0 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV                                             !0      
          1        FETCH_OBJ_R                                      ~1      !0, 'Person.P_Id'
          2        CAST                                          6  ~2      ~1
          3      > RETURN                                                   ~2
          4*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.42 ms | 1005 KiB | 16 Q