3v4l.org

run code in 300+ PHP versions simultaneously
<?php $tests = array("400 seconds", "400.1 seconds", "400.12 seconds", "400.123 seconds"); foreach ($tests as $index => $test) { var_dump(DateInterval->createFromDateString($test)->format("%Hh, %im, %ss")); var_dump(parse_date($test)); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 21
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 21
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
filename:       /in/jbB7k
function name:  (null)
number of ops:  23
compiled vars:  !0 = $tests, !1 = $test, !2 = $index
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    4     1      > FE_RESET_R                                       $4      !0, ->21
          2    > > FE_FETCH_R                                       ~5      $4, !1, ->21
          3    >   ASSIGN                                                   !2, ~5
    5     4        INIT_FCALL                                               'var_dump'
          5        FETCH_CONSTANT                                   ~7      'DateInterval'
          6        INIT_METHOD_CALL                                         ~7, 'createFromDateString'
          7        SEND_VAR_EX                                              !1
          8        DO_FCALL                                      0  $8      
          9        INIT_METHOD_CALL                                         $8, 'format'
         10        SEND_VAL_EX                                              '%25Hh%2C+%25im%2C+%25ss'
         11        DO_FCALL                                      0  $9      
         12        SEND_VAR                                                 $9
         13        DO_ICALL                                                 
    6    14        INIT_FCALL                                               'var_dump'
         15        INIT_FCALL_BY_NAME                                       'parse_date'
         16        SEND_VAR_EX                                              !1
         17        DO_FCALL                                      0  $11     
         18        SEND_VAR                                                 $11
         19        DO_ICALL                                                 
    4    20      > JMP                                                      ->2
         21    >   FE_FREE                                                  $4
    7    22      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.59 ms | 1395 KiB | 15 Q