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 = 20
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 20
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
filename:       /in/PQbSP
function name:  (null)
number of ops:  22
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, ->20
          2    > > FE_FETCH_R                                       ~5      $4, !1, ->20
          3    >   ASSIGN                                                   !2, ~5
    5     4        INIT_FCALL                                               'var_dump'
          5        INIT_STATIC_METHOD_CALL                                  'DateInterval', 'createFromDateString'
          6        SEND_VAR                                                 !1
          7        DO_FCALL                                      0  $7      
          8        INIT_METHOD_CALL                                         $7, 'format'
          9        SEND_VAL_EX                                              '%25Hh%2C+%25im%2C+%25ss'
         10        DO_FCALL                                      0  $8      
         11        SEND_VAR                                                 $8
         12        DO_ICALL                                                 
    6    13        INIT_FCALL                                               'var_dump'
         14        INIT_FCALL_BY_NAME                                       'parse_date'
         15        SEND_VAR_EX                                              !1
         16        DO_FCALL                                      0  $10     
         17        SEND_VAR                                                 $10
         18        DO_ICALL                                                 
    4    19      > JMP                                                      ->2
         20    >   FE_FREE                                                  $4
    7    21      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.83 ms | 1387 KiB | 15 Q