3v4l.org

run code in 300+ PHP versions simultaneously
<?php $total_seconds = 0; $dom = new DOMDocument(); $dom->loadXML(file_get_contents('https://www.googleapis.com/youtube/v3/playlistItems?part=id&maxResults=0&playlistId=PLsDlOcV-nPMxzr8X99EcHuQWnf81DCXKc&key=AIzaSyCA3cc5Gci2lI8dTW7wiEH_X8Pvcm-w6jo')); $xpath = new DOMXPath($dom); foreach ($xpath->query('//yt:duration/@seconds') as $duration) { $total_seconds += (int) $duration->value; } echo (int) ($total_seconds / 3600) . ':' . (int) ($total_seconds / 60) % 60 . ':' . $total_seconds % 60;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 18, Position 2 = 23
Branch analysis from position: 18
2 jumps found. (Code = 78) Position 1 = 19, Position 2 = 23
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 23
filename:       /in/DYYGN
function name:  (null)
number of ops:  36
compiled vars:  !0 = $total_seconds, !1 = $dom, !2 = $xpath, !3 = $duration
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 0
    5     1        NEW                                              $5      'DOMDocument'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $5
    6     4        INIT_METHOD_CALL                                         !1, 'loadXML'
          5        INIT_FCALL                                               'file_get_contents'
          6        SEND_VAL                                                 'https%3A%2F%2Fwww.googleapis.com%2Fyoutube%2Fv3%2FplaylistItems%3Fpart%3Did%26maxResults%3D0%26playlistId%3DPLsDlOcV-nPMxzr8X99EcHuQWnf81DCXKc%26key%3DAIzaSyCA3cc5Gci2lI8dTW7wiEH_X8Pvcm-w6jo'
          7        DO_ICALL                                         $8      
          8        SEND_VAR_NO_REF_EX                                       $8
          9        DO_FCALL                                      0          
    8    10        NEW                                              $10     'DOMXPath'
         11        SEND_VAR_EX                                              !1
         12        DO_FCALL                                      0          
         13        ASSIGN                                                   !2, $10
    9    14        INIT_METHOD_CALL                                         !2, 'query'
         15        SEND_VAL_EX                                              '%2F%2Fyt%3Aduration%2F%40seconds'
         16        DO_FCALL                                      0  $13     
         17      > FE_RESET_R                                       $14     $13, ->23
         18    > > FE_FETCH_R                                               $14, !3, ->23
   11    19    >   FETCH_OBJ_R                                      ~15     !3, 'value'
         20        CAST                                          4  ~16     ~15
         21        ASSIGN_OP                                     1          !0, ~16
    9    22      > JMP                                                      ->18
         23    >   FE_FREE                                                  $14
   14    24        DIV                                              ~18     !0, 3600
         25        CAST                                          4  ~19     ~18
         26        CONCAT                                           ~20     ~19, '%3A'
         27        DIV                                              ~21     !0, 60
         28        CAST                                          4  ~22     ~21
         29        MOD                                              ~23     ~22, 60
         30        CONCAT                                           ~24     ~20, ~23
         31        CONCAT                                           ~25     ~24, '%3A'
         32        MOD                                              ~26     !0, 60
         33        CONCAT                                           ~27     ~25, ~26
         34        ECHO                                                     ~27
         35      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.93 ms | 1396 KiB | 15 Q