3v4l.org

run code in 300+ PHP versions simultaneously
<?php $x = <<<XML <data type="current observations"> <time-layout time-coordinate="local"> <start-valid-time period-name="current">2013-05-27T13:53:00-04:00</start-valid-time> </time-layout> </data> XML; $weather = new SimpleXMLElement($x); $data = $weather->xpath('/data[@type="current observations"]'); $time_layout = $data[0]->xpath('time-layout[@time-coordinate="local"]'); $start_valid_time = $time_layout[0]->xpath('start-valid-time[@period-name="current"]'); echo (string)$start_valid_time[0]->value;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dQL6g
function name:  (null)
number of ops:  24
compiled vars:  !0 = $x, !1 = $weather, !2 = $data, !3 = $time_layout, !4 = $start_valid_time
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%3Cdata+type%3D%22current+observations%22%3E%0A++++%3Ctime-layout+time-coordinate%3D%22local%22%3E%0A++++++++%3Cstart-valid-time+period-name%3D%22current%22%3E2013-05-27T13%3A53%3A00-04%3A00%3C%2Fstart-valid-time%3E%0A++++%3C%2Ftime-layout%3E%0A%3C%2Fdata%3E'
   10     1        NEW                                              $6      'SimpleXMLElement'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !1, $6
   12     5        INIT_METHOD_CALL                                         !1, 'xpath'
          6        SEND_VAL_EX                                              '%2Fdata%5B%40type%3D%22current+observations%22%5D'
          7        DO_FCALL                                      0  $9      
          8        ASSIGN                                                   !2, $9
   13     9        FETCH_DIM_R                                      ~11     !2, 0
         10        INIT_METHOD_CALL                                         ~11, 'xpath'
         11        SEND_VAL_EX                                              'time-layout%5B%40time-coordinate%3D%22local%22%5D'
         12        DO_FCALL                                      0  $12     
         13        ASSIGN                                                   !3, $12
   14    14        FETCH_DIM_R                                      ~14     !3, 0
         15        INIT_METHOD_CALL                                         ~14, 'xpath'
         16        SEND_VAL_EX                                              'start-valid-time%5B%40period-name%3D%22current%22%5D'
         17        DO_FCALL                                      0  $15     
         18        ASSIGN                                                   !4, $15
   15    19        FETCH_DIM_R                                      ~17     !4, 0
         20        FETCH_OBJ_R                                      ~18     ~17, 'value'
         21        CAST                                          6  ~19     ~18
         22        ECHO                                                     ~19
         23      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.1 ms | 1394 KiB | 13 Q