3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getExpirationDate($months) { $date=strftime('%c'); //Get the current date $date=strtotime($date); $date = strtotime("+$months months", $date); //Add x number of months to the date $date = strtotime("+7 days", $date); //Add 7 days just to be sure $expired=date('Y-m-d H:i:s',$date); return $expired; } print_r(getExpirationDate(0.9)); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hMAfl
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   INIT_FCALL                                               'print_r'
          1        INIT_FCALL                                               'getexpirationdate'
          2        SEND_VAL                                                 0.9
          3        DO_FCALL                                      0  $0      
          4        SEND_VAR                                                 $0
          5        DO_ICALL                                                 
   13     6      > RETURN                                                   1

Function getexpirationdate:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hMAfl
function name:  getExpirationDate
number of ops:  29
compiled vars:  !0 = $months, !1 = $date, !2 = $expired
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    3     1        INIT_FCALL                                               'strftime'
          2        SEND_VAL                                                 '%25c'
          3        DO_ICALL                                         $3      
          4        ASSIGN                                                   !1, $3
    4     5        INIT_FCALL                                               'strtotime'
          6        SEND_VAR                                                 !1
          7        DO_ICALL                                         $5      
          8        ASSIGN                                                   !1, $5
    5     9        INIT_FCALL                                               'strtotime'
         10        ROPE_INIT                                     3  ~8      '%2B'
         11        ROPE_ADD                                      1  ~8      ~8, !0
         12        ROPE_END                                      2  ~7      ~8, '+months'
         13        SEND_VAL                                                 ~7
         14        SEND_VAR                                                 !1
         15        DO_ICALL                                         $10     
         16        ASSIGN                                                   !1, $10
    6    17        INIT_FCALL                                               'strtotime'
         18        SEND_VAL                                                 '%2B7+days'
         19        SEND_VAR                                                 !1
         20        DO_ICALL                                         $12     
         21        ASSIGN                                                   !1, $12
    7    22        INIT_FCALL                                               'date'
         23        SEND_VAL                                                 'Y-m-d+H%3Ai%3As'
         24        SEND_VAR                                                 !1
         25        DO_ICALL                                         $14     
         26        ASSIGN                                                   !2, $14
    8    27      > RETURN                                                   !2
    9    28*     > RETURN                                                   null

End of function getexpirationdate

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.77 ms | 1399 KiB | 22 Q