Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:70589 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 36212 invoked from network); 11 Dec 2013 11:42:42 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Dec 2013 11:42:42 -0000 Authentication-Results: pb1.pair.com smtp.mail=inefedor@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=inefedor@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.215.41 as permitted sender) X-PHP-List-Original-Sender: inefedor@gmail.com X-Host-Fingerprint: 209.85.215.41 mail-la0-f41.google.com Received: from [209.85.215.41] ([209.85.215.41:64954] helo=mail-la0-f41.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A7/B1-22966-1BF48A25 for ; Wed, 11 Dec 2013 06:42:42 -0500 Received: by mail-la0-f41.google.com with SMTP id eo20so3651334lab.14 for ; Wed, 11 Dec 2013 03:42:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:to:cc:subject:references:date:mime-version :content-transfer-encoding:from:message-id:in-reply-to:user-agent; bh=t639XYNEFANvVIQ7W4oWXZ9oPmUzcD3yBLmEsonM2g0=; b=U7w44grK/IIzuUtqh8nNgntiAovno8hR8DPcnHMVK5n0ozFjBHtiN4ZhsTCXFYlTVH 91bQxgh8hJEWRiySGcqvWJz+CbuclZAGvwBh1vYdpt1kPdgqHLx2r1payOVVyt5V2KyM 3DTxRNgA/PKlDVKNKswhb6f+WhXvWZInEFOKsjfQS0UGxM7YRTrKM6+eTzeq4BwzuYai PoFRAVuFK3f0bw4GwKd78+DlDwVU1BWY93j5hUOR9R3NP/nujfirOsix8z2+hM5ISWIl Wajbqdvx2Dggme+MsdjRI+ws9/edtnlJHTr9endEMKL/cegledOk/5EV+/+BJ+/lm/tM uNlA== X-Received: by 10.152.19.131 with SMTP id f3mr5977lae.87.1386762158335; Wed, 11 Dec 2013 03:42:38 -0800 (PST) Received: from nikita2206-n56vj ([217.174.184.92]) by mx.google.com with ESMTPSA id c8sm27914048lag.3.2013.12.11.03.42.37 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 11 Dec 2013 03:42:37 -0800 (PST) Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: "Derick Rethans" Cc: "internals@lists.php.net" References: Date: Wed, 11 Dec 2013 15:42:36 +0400 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Message-ID: In-Reply-To: User-Agent: Opera Mail/12.16 (Linux) Subject: Re: [PHP-DEV] timelib diff working wrong on with years From: inefedor@gmail.com ("Nikita Nefedov") On Wed, 11 Dec 2013 14:13:07 +0400, Derick Rethans wrote: > On Wed, 11 Dec 2013, Nikita Nefedov wrote: > >> Hi, >> >> today I stumbled upon this bug, but I actually don't know should I call >> it bug >> or is it right behavior? >> >> So for example lets get diff between 2013-10-25 and 2014-10-25: >> var_dump((new DateTime("2013-03-25"))->diff(new DateTime("2014-03-25"))) >> >> We'll get one full year. >> >> Then if we try to get diff between 2012-03-25 and 2013-03-25 we'll also >> get >> one year. >> >> But if we have 2012-03-01 and 2013-03-01 then we get 11 months and 30 >> days >> (365 in int->days member)... >> >> Should we consider this as a bug or not? > > I did some fixes for this already - which version of PHP is this? > > cheers, > Derick > Hi Derick, I can reproduce this on 5.5.7RC1 tag. (can't check it on the other versions at the moment)