3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo $phpdate = strtotime('-1 day'); echo PHP_EOL; $mysqldate = date('Y-m-d H:i:s', $phpdate); function d($phpdate) { if(date('Y-m-d') == date('Y-m-d', $phpdate)) { return 'Today at ' . date("g:ia", $phpdate); } else if(date('Y-m-d', strtotime('-1 day')) == date('Y-m-d', $phpdate)) { return "Yesterday at" + date("g:ia", $phpdate); } else { return date("m-d-Y g:ia", $phpdate); } } echo d($phpdate); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZNhha
function name:  (null)
number of ops:  16
compiled vars:  !0 = $phpdate, !1 = $mysqldate
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   INIT_FCALL                                               'strtotime'
          1        SEND_VAL                                                 '-1+day'
          2        DO_ICALL                                         $2      
          3        ASSIGN                                           ~3      !0, $2
          4        ECHO                                                     ~3
    5     5        ECHO                                                     '%0A'
    6     6        INIT_FCALL                                               'date'
          7        SEND_VAL                                                 'Y-m-d+H%3Ai%3As'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                         $4      
         10        ASSIGN                                                   !1, $4
   21    11        INIT_FCALL                                               'd'
         12        SEND_VAR                                                 !0
         13        DO_FCALL                                      0  $6      
         14        ECHO                                                     $6
   24    15      > RETURN                                                   1

Function d:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 17
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
2 jumps found. (Code = 43) Position 1 = 30, Position 2 = 37
Branch analysis from position: 30
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 37
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZNhha
function name:  d
number of ops:  43
compiled vars:  !0 = $phpdate
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
    9     1        INIT_FCALL                                               'date'
          2        SEND_VAL                                                 'Y-m-d'
          3        DO_ICALL                                         $1      
          4        INIT_FCALL                                               'date'
          5        SEND_VAL                                                 'Y-m-d'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                         $2      
          8        IS_EQUAL                                                 $1, $2
          9      > JMPZ                                                     ~3, ->17
   10    10    >   INIT_FCALL                                               'date'
         11        SEND_VAL                                                 'g%3Aia'
         12        SEND_VAR                                                 !0
         13        DO_ICALL                                         $4      
         14        CONCAT                                           ~5      'Today+at+', $4
         15      > RETURN                                                   ~5
         16*       JMP                                                      ->42
   12    17    >   INIT_FCALL                                               'date'
         18        SEND_VAL                                                 'Y-m-d'
         19        INIT_FCALL                                               'strtotime'
         20        SEND_VAL                                                 '-1+day'
         21        DO_ICALL                                         $6      
         22        SEND_VAR                                                 $6
         23        DO_ICALL                                         $7      
         24        INIT_FCALL                                               'date'
         25        SEND_VAL                                                 'Y-m-d'
         26        SEND_VAR                                                 !0
         27        DO_ICALL                                         $8      
         28        IS_EQUAL                                                 $7, $8
         29      > JMPZ                                                     ~9, ->37
   13    30    >   INIT_FCALL                                               'date'
         31        SEND_VAL                                                 'g%3Aia'
         32        SEND_VAR                                                 !0
         33        DO_ICALL                                         $10     
         34        ADD                                              ~11     'Yesterday+at', $10
         35      > RETURN                                                   ~11
         36*       JMP                                                      ->42
   16    37    >   INIT_FCALL                                               'date'
         38        SEND_VAL                                                 'm-d-Y+g%3Aia'
         39        SEND_VAR                                                 !0
         40        DO_ICALL                                         $12     
         41      > RETURN                                                   $12
   18    42*     > RETURN                                                   null

End of function d

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.98 ms | 1407 KiB | 18 Q