3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = 'P0DT0H4M13S'; $interval = new DateInterval($str); $output = ''; if ($interval->d) { $output = $interval->format('%d DAY '); } $output .= $interval->format('%H:%I:%S'); echo $output;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 12
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
filename:       /in/XE8fO
function name:  (null)
number of ops:  18
compiled vars:  !0 = $str, !1 = $interval, !2 = $output
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, 'P0DT0H4M13S'
    6     1        NEW                                              $4      'DateInterval'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !1, $4
    7     5        ASSIGN                                                   !2, ''
    8     6        FETCH_OBJ_R                                      ~8      !1, 'd'
          7      > JMPZ                                                     ~8, ->12
    9     8    >   INIT_METHOD_CALL                                         !1, 'format'
          9        SEND_VAL_EX                                              '%25d+DAY+'
         10        DO_FCALL                                      0  $9      
         11        ASSIGN                                                   !2, $9
   11    12    >   INIT_METHOD_CALL                                         !1, 'format'
         13        SEND_VAL_EX                                              '%25H%3A%25I%3A%25S'
         14        DO_FCALL                                      0  $11     
         15        ASSIGN_OP                                     8          !2, $11
   12    16        ECHO                                                     !2
   13    17      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.32 ms | 1007 KiB | 13 Q