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"]')[0]; $time_layout = $data->xpath('time-layout[@time-coordinate="local"]')[0]; $start_valid_time = $time_layout->xpath('start-valid-time[@period-name="current"]')[0]; echo (string)$start_valid_time;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vgtbo
function name:  (null)
number of ops:  23
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        FETCH_DIM_R                                      ~10     $9, 0
          9        ASSIGN                                                   !2, ~10
   13    10        INIT_METHOD_CALL                                         !2, 'xpath'
         11        SEND_VAL_EX                                              'time-layout%5B%40time-coordinate%3D%22local%22%5D'
         12        DO_FCALL                                      0  $12     
         13        FETCH_DIM_R                                      ~13     $12, 0
         14        ASSIGN                                                   !3, ~13
   14    15        INIT_METHOD_CALL                                         !3, 'xpath'
         16        SEND_VAL_EX                                              'start-valid-time%5B%40period-name%3D%22current%22%5D'
         17        DO_FCALL                                      0  $15     
         18        FETCH_DIM_R                                      ~16     $15, 0
         19        ASSIGN                                                   !4, ~16
   15    20        CAST                                          6  ~18     !4
         21        ECHO                                                     ~18
         22      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.15 ms | 1394 KiB | 13 Q