Skip to content

fix bug 63392 #224

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 5 commits into from
Closed

fix bug 63392 #224

wants to merge 5 commits into from

Conversation

xuzhi
Copy link

@xuzhi xuzhi commented Oct 31, 2012

i delete these code if(time->relative.weekday == 0)time->relative.weekday == 7; these code cause bug 63392 , bug test script blow

modify("Sunday this week"); var_dump($dt->format('r')); ## Expected result: string(31) "Sun, 13 May 2012 00:00:00 +0000" ## Actual result: string(31) "Sun, 20 May 2012 00:00:00 +0000"

xuzhi added 2 commits October 30, 2012 18:25
fix  Bug #63392  由于 我是第一次参与php源码的工作,有很多东西不太清楚。这个bug  不知道原始的作者
是怎么考虑的,会出现那么奇怪的赋值。
fix bug #63392 old code is if(time->relative.weekday == 0)time->relative.weekday == 7
i don't konw  why author write this code
@laruence
Copy link
Member

  1. 如果你要删除这段代码, 就整个删除吧
  2. 合并成一个提交, 方便我们看到你到底改了什么
  3. 写一个phpt 测试文件, 至于怎么写phpt, 我想你可以根据现有的照猫画图.

thanks :)

@xuzhi
Copy link
Author

xuzhi commented Oct 31, 2012

ok ,由于刚开始 参与,比较生疏。

------------------ 原始邮件 ------------------
发件人: "Xinchen Hui"notifications@github.com;
发送时间: 2012年10月31日(星期三) 下午4:52
收件人: "php/php-src"php-src@noreply.github.com;
抄送: "xuzhi"767994038@qq.com;
主题: Re: [php-src] fix bug 63392 (#224)

如果你要删除这段代码, 就整个删除吧
合并成一个提交, 方便我们看到你到底改了什么
写一个phpt 测试文件, 至于怎么写phpt, 我想你可以根据现有的照猫画图.

thanks :)


Reply to this email directly or view it on GitHub.

@nikic
Copy link
Member

nikic commented Oct 31, 2012

Would be nice to keep PR comments in English so other people can read them too ;)

@alkavan
Copy link

alkavan commented Oct 31, 2012

Ya... try English please. I actually read that one on gmail, and instant translate option was available. but this is not the case for everyone :-)

@xuzhi
Copy link
Author

xuzhi commented Nov 1, 2012

I had commit bug63392.phpt in /php-src/ext/date/tests/ i had delete " (time->relative.weekday==0) time->relative.weekday==7 ;" in tm2unixtime.c , these code cause bug63392.

@@ -0,0 +1,21 @@
--TEST--
Bug #63392 (DateTime::modify() start of week inconsistency)
Description:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could use DESCRIPTION Section like this:
https://github.com/php/php-src/blob/master/Zend/tests/bug60825.phpt#L1

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I already corrent the mistake that you said above.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here, I mean you could move the description to a new section, or it will output with the test name, that looks ugly :)

--DESCRIPTION--
......

@laruence
Copy link
Member

laruence commented Nov 2, 2012

the codes you removed seems a intentional logic, so I really doubt this fix.
so RM, please don't merge this, leave it to the author

@lstrojny
Copy link
Contributor

lstrojny commented Nov 4, 2012

Ping @derickr

@derickr
Copy link
Member

derickr commented Nov 4, 2012

Laruence had pinged me about this on IRC, and I would need to re-double check if this is broken in the first place. I am doubting that at the moment, but can't find my copy of my book :-)

@lstrojny
Copy link
Contributor

@derickr ping again :)

@cmbuckley
Copy link

For anyone who's interested, the change was introduced in 357292a.

@dsp
Copy link
Member

dsp commented Sep 16, 2013

ping @derickr

@smalyshev smalyshev added the Bug label Nov 24, 2014
@php-pulls
Copy link

Comment on behalf of cmb at php.net:

This PR is obsolete, as the issue has already been fixed with commit f43f6fc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.