3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php echo "Now: ", $now = strtotime("now"), "\n"; echo "Then: ", $then = strtotime("now -2 years"), "\n"; echo "400 years ago: ", $now2 = strtotime("now -6 years"), "\n"; echo "420 years ago: ", $then2 = strtotime("now -8 years"), "\n"; echo "Dif 1: ", $dif1 = ($now-$then) / 60 / 60, " hours\n"; echo "Dif 2: ", $dif2 = ($now2-$then2) / 60 / 60, " hours\n"; echo "Simple: ", $simple = 2*365*24, " hours\n"; echo "Dif1 to dif2 ", $dif1 - $dif2, "hours\n"; echo "Dif1 to simple ", $dif1 - $simple, "hours\n";
based on mpO4P
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/4uiE2
function name:  (null)
number of ops:  55
compiled vars:  !0 = $now, !1 = $then, !2 = $now2, !3 = $then2, !4 = $dif1, !5 = $dif2, !6 = $simple
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   3     0  E >   ECHO                                                     'Now%3A+'
         1        INIT_FCALL                                               'strtotime'
         2        SEND_VAL                                                 'now'
         3        DO_ICALL                                         $7      
         4        ASSIGN                                           $8      !0, $7
         5        ECHO                                                     $8
         6        ECHO                                                     '%0A'
   4     7        ECHO                                                     'Then%3A+'
         8        INIT_FCALL                                               'strtotime'
         9        SEND_VAL                                                 'now+-2+years'
        10        DO_ICALL                                         $9      
        11        ASSIGN                                           $10     !1, $9
        12        ECHO                                                     $10
        13        ECHO                                                     '%0A'
   5    14        ECHO                                                     '400+years+ago%3A+'
        15        INIT_FCALL                                               'strtotime'
        16        SEND_VAL                                                 'now+-6+years'
        17        DO_ICALL                                         $11     
        18        ASSIGN                                           $12     !2, $11
        19        ECHO                                                     $12
        20        ECHO                                                     '%0A'
   6    21        ECHO                                                     '420+years+ago%3A+'
        22        INIT_FCALL                                               'strtotime'
        23        SEND_VAL                                                 'now+-8+years'
        24        DO_ICALL                                         $13     
        25        ASSIGN                                           $14     !3, $13
        26        ECHO                                                     $14
        27        ECHO                                                     '%0A'
   8    28        ECHO                                                     'Dif+1%3A+'
        29        SUB                                              ~15     !0, !1
        30        DIV                                              ~16     ~15, 60
        31        DIV                                              ~17     ~16, 60
        32        ASSIGN                                           $18     !4, ~17
        33        ECHO                                                     $18
        34        ECHO                                                     '+hours%0A'
   9    35        ECHO                                                     'Dif+2%3A+'
        36        SUB                                              ~19     !2, !3
        37        DIV                                              ~20     ~19, 60
        38        DIV                                              ~21     ~20, 60
        39        ASSIGN                                           $22     !5, ~21
        40        ECHO                                                     $22
        41        ECHO                                                     '+hours%0A'
  10    42        ECHO                                                     'Simple%3A+'
        43        ASSIGN                                           $23     !6, 17520
        44        ECHO                                                     $23
        45        ECHO                                                     '+hours%0A'
  11    46        ECHO                                                     'Dif1+to+dif2+'
        47        SUB                                              ~24     !4, !5
        48        ECHO                                                     ~24
        49        ECHO                                                     'hours%0A'
  12    50        ECHO                                                     'Dif1+to+simple+'
        51        SUB                                              ~25     !4, !6
        52        ECHO                                                     ~25
        53        ECHO                                                     'hours%0A'
        54      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 7.3.0