php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #8987 arg returned from function comes back as string 'ready', regardless of actual
Submitted: 2001-01-29 16:42 UTC Modified: 2001-01-29 17:16 UTC
From: gordonl at tts-sf dot com Assigned:
Status: Closed Package: Unknown/Other Function
PHP Version: 4.0.3pl1 OS: linux mandrake apache ssl
Private report: No CVE-ID: None
 [2001-01-29 16:42 UTC] gordonl at tts-sf dot com
I created the function [==
  function incdate($datei,$inc) {
    $dateparts =explode("/",$datei);
    $day = $dateparts[1] + $inc;
    $month = $dateparts[0];
    $year = $dateparts[2];
    $dec = 0;
    //echo($datei . "cc" . $day . "cc" . $month . "cc" . $year . "<br>");
    if($day > 31 && ($month == 1 || $month == 3 || $month == 5 || $month == 7 || $month == 8 || $month == 10 || $month == 12)) { $dec=31; }   
    if($day > 30 && ($month == 4 || $month == 6 || $month == 9 || $month == 11)) { $dec=30; }   
    if($day > 28 && $month == 2 && $year % 4 != 0) {$dec=28;}   
    if($day > 29 && $month == 2 && $year % 4 == 0) {$dec=29;}   
    while ($dec != 0 ) {
      $day = $day - $dec;
      $month++;
      if ($month > 12) { $year++; $month = 1; }
      $dec = 0;
      if ($day > 31 && ($month == 1 || $month == 3 || $month == 5 || $month == 7 || $month == 8 || $month == 10 || $month == 12)) { $dec=31; }   
      if ($day > 30 && ($month == 4 || $month == 6 || $month == 9 || $month == 11)) { $dec=30; }   
      if ($day > 28 && $month == 2 && $year % 4 != 0) {$dec=28;}   
      if ($day > 29 && $month == 2 && $year % 4 == 0) {$dec=29;}   
      }
   //echo ("out: " . $month . "/" . $day . "/" . $year . "<br>");
   $outdat = "f" . $month . "-" . $day . "-" . $year;
   return $outdat;
   }
==]
it returns 'ready' to the calling statement, regardless of the actual value of '$outdat'.
I haved tried many variations in my code, but the result does not change.  

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-01-29 17:16 UTC] derick@php.net
Could you post the calling code as .txt on the web somewhere for us to see. This is almost certain a user error and not a bug.
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Sat Jul 11 18:01:24 2020 UTC