3v4l.org

run code in 300+ PHP versions simultaneously
<?php $intervals = array( '0' => 0, '86400' => 86400, '0 second' => 0, '1 second' => 1, '1 minute' => 60, '1 hour' => 60 * 60, '1 day' => 60 * 60 * 24, '1 year' => 60 * 60 * 24 * 365, '1 day + 12 hours' => 60 * 60 * 24 + 12 * 60 * 60 ); foreach ($intervals as $interval => $expected) { if (is_numeric($interval)) { $found = (int) $interval; } else { $zeroDate = new \DateTime('0'); $zeroDate->add(\DateInterval::createFromDateString($interval)); $found = $zeroDate->getTimestamp(); } echo sprintf("found %s expected %s\n", $found, $expected); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 31
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 31
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 11
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 31
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 31
filename:       /in/qL7bM
function name:  (null)
number of ops:  33
compiled vars:  !0 = $intervals, !1 = $expected, !2 = $interval, !3 = $found, !4 = $zeroDate
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
   14     1      > FE_RESET_R                                       $6      !0, ->31
          2    > > FE_FETCH_R                                       ~7      $6, !1, ->31
          3    >   ASSIGN                                                   !2, ~7
   15     4        INIT_FCALL                                               'is_numeric'
          5        SEND_VAR                                                 !2
          6        DO_ICALL                                         $9      
          7      > JMPZ                                                     $9, ->11
   16     8    >   CAST                                          4  ~10     !2
          9        ASSIGN                                                   !3, ~10
         10      > JMP                                                      ->24
   18    11    >   NEW                                              $12     'DateTime'
         12        SEND_VAL_EX                                              '0'
         13        DO_FCALL                                      0          
         14        ASSIGN                                                   !4, $12
   19    15        INIT_METHOD_CALL                                         !4, 'add'
         16        INIT_STATIC_METHOD_CALL                                  'DateInterval', 'createFromDateString'
         17        SEND_VAR                                                 !2
         18        DO_FCALL                                      0  $15     
         19        SEND_VAR_NO_REF_EX                                       $15
         20        DO_FCALL                                      0          
   20    21        INIT_METHOD_CALL                                         !4, 'getTimestamp'
         22        DO_FCALL                                      0  $17     
         23        ASSIGN                                                   !3, $17
   23    24    >   INIT_FCALL                                               'sprintf'
         25        SEND_VAL                                                 'found+%25s+expected+%25s%0A'
         26        SEND_VAR                                                 !3
         27        SEND_VAR                                                 !1
         28        DO_ICALL                                         $19     
         29        ECHO                                                     $19
   14    30      > JMP                                                      ->2
         31    >   FE_FREE                                                  $6
   24    32      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.9 ms | 1396 KiB | 17 Q