Re: [PHP-DEV] RM decision on BUG #55801 / FR #36424

2011-10-18 Thread Michael Wallner
On Sat, 15 Oct 2011 17:06:19 -0700, Stas Malyshev wrote:

 Hi!
 
 So, what is the status of this? I think we better revert it for 5.4 and
 look for solution that does not mess up existing code.

Hi there!

Yes, I received your mails, sorry for being quiet!

I cooked up a patch which uses clean var_hashs or (un)serialize 
within __wakeup and __sleep.

Tests pass, my test case in the bug produces a stack overflow,
which is IMO expected.  I'm just waiting for feedback of the
bug reporter.

Thanks,
Mike



-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DEV] Re: date_diff fixes status

2011-10-18 Thread Derick Rethans
On Sat, 15 Oct 2011, Stas Malyshev wrote:

 What is the status of fixing date module with regard to TLA timezones 
 handling - this code still fails:

Daniel will be publishing an RFC today, after that we have what we want 
and can have a stab at fixing it.

Derick

-- 
http://derickrethans.nl | http://xdebug.org
Like Xdebug? Consider a donation: http://xdebug.org/donate.php
twitter: @derickr and @xdebug

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DEV] php 5.4 next iteration

2011-10-18 Thread Stas Malyshev

Hi!

Since we have next release planned on 20th, and since we have at least 
three unsolved issues for 5.4 yet which we expect resolution soon:

- is_a question
- serialization changes
- date fixes

I think the release on 20th should be beta2 and we can start the RC 
cycle once these are resolved. BTW, if anyone remembers anything else 
that must be resolved before RC and isn't yet, please raise the flag.


Also, it'd be great if we could get some attention to the missing 
documentation: https://wiki.php.net/todo/undoc54

--
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] php 5.4 next iteration

2011-10-18 Thread Nikita Popov
I would also like to have some decision on
https://bugs.php.net/bug.php?id=54089 (there already was some
discussion about this @
http://www.mail-archive.com/internals@lists.php.net/msg53411.html but
no consensus was reached).

On Tue, Oct 18, 2011 at 8:03 PM, Stas Malyshev smalys...@sugarcrm.com wrote:
 Hi!

 Since we have next release planned on 20th, and since we have at least three
 unsolved issues for 5.4 yet which we expect resolution soon:
 - is_a question
 - serialization changes
 - date fixes

 I think the release on 20th should be beta2 and we can start the RC cycle
 once these are resolved. BTW, if anyone remembers anything else that must be
 resolved before RC and isn't yet, please raise the flag.

 Also, it'd be great if we could get some attention to the missing
 documentation: https://wiki.php.net/todo/undoc54
 --
 Stanislav Malyshev, Software Architect
 SugarCRM: http://www.sugarcrm.com/
 (408)454-6900 ext. 227

 --
 PHP Internals - PHP Runtime Development Mailing List
 To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] php 5.4 next iteration

2011-10-18 Thread Ferenc Kovacs
On Tue, Oct 18, 2011 at 9:36 PM, Pierre Joye pierre@gmail.com wrote:

 On Tue, Oct 18, 2011 at 8:03 PM, Stas Malyshev smalys...@sugarcrm.com
 wrote:
  Hi!
 
  Since we have next release planned on 20th, and since we have at least
 three
  unsolved issues for 5.4 yet which we expect resolution soon:
  - is_a question

 where is the question? You seem to be the only one to disagree with
 the revert and the proposed patch. Rasmus and other agreed on it
 already, here and the security list.


please keep in mind that the security is a closed group so most of the
readers don't know the discussion happening there, so maybe it would be a
good idea to summarize the discussion here and maybe mention who are exactly
Rasmus and other.


  - serialization changes

 BC break, it should be reverted.


see http://www.mail-archive.com/internals@lists.php.net/msg53939.html



  - date fixes

 Any ref or link on those please?


see http://www.mail-archive.com/internals@lists.php.net/msg53940.html
imo the date related XFAILS should be fixed before 5.4


-- 
Ferenc Kovács
@Tyr43l - http://tyrael.hu


Re: [PHP-DEV] Ternary operator performance improvements

2011-10-18 Thread Arnaud Le Blanc
Hi,

Le Monday 17 October 2011 15:07:30, Alain Williams a écrit :
 On Fri, Oct 14, 2011 at 08:08:56PM +0200, Arnaud Le Blanc wrote:
  Hi,
  
  I've already posted this patch and it has since been reviewed and
  improved. I'm re-posting it for discussion before eventually commiting
  it.
  
  The ternary operator always copies its second or third operand, which is
  very
 
  slow compared to an if/else when the operand is an array for example:
 Is that why the following does not work as I expected:
 
 $dbh = $how == 'r' ? ($dbh_r) : ($dbh_w);
 
 $dbh is NOT a reference to $dbh_r or $dbh_w.

This is expected; 
http://docs.php.net/manual/en/language.operators.comparison.php explains it:

 Please note that the ternary operator is a statement, and that it doesn't 
evaluate to a variable, but to the result of a statement.

This is why you can't assign the result of the ternary operator by reference. 
The patch doesn't change this.

Best regards,

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] php 5.4 next iteration

2011-10-18 Thread Stas Malyshev

Hi!

On 10/18/11 12:36 PM, Pierre Joye wrote:

where is the question? You seem to be the only one to disagree with
the revert and the proposed patch. Rasmus and other agreed on it
already, here and the security list.


The patch is still not applied. If nobody agrees with me - ok, apply it 
then. But this is a substantial change so I don't want to do it in RC 
phase.



- serialization changes


BC break, it should be reverted.


Should be, but isn't yet. Michael says he has a fix for it.


- date fixes


Any ref or link on those please?


All Date XFAILs, pretty much. If you intend to help Derick and Daniel 
look into it, I can give you more info (it was already discussed, but I 
don't want to spend time summarizing it unless it's needed).

--
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] Ternary operator performance improvements

2011-10-18 Thread Alain Williams
On Tue, Oct 18, 2011 at 10:09:37PM +0200, Arnaud Le Blanc wrote:
 Hi,
 
 Le Monday 17 October 2011 15:07:30, Alain Williams a écrit :
  On Fri, Oct 14, 2011 at 08:08:56PM +0200, Arnaud Le Blanc wrote:
   Hi,
   
   I've already posted this patch and it has since been reviewed and
   improved. I'm re-posting it for discussion before eventually commiting
   it.
   
   The ternary operator always copies its second or third operand, which is
   very
  
   slow compared to an if/else when the operand is an array for example:
  Is that why the following does not work as I expected:
  
  $dbh = $how == 'r' ? ($dbh_r) : ($dbh_w);
  
  $dbh is NOT a reference to $dbh_r or $dbh_w.
 
 This is expected; 
 http://docs.php.net/manual/en/language.operators.comparison.php explains it:

It probably does, but it is quite subtle. I was expecting the above to work 
since
it does in C -- although in C variable is an address which can be used in an
expression ... the PHP '' operator is different, in spite of apparent 
similarities.

Explained here, but still 

http://docs.php.net/manual/en/language.references.arent.php

  Please note that the ternary operator is a statement, and that it doesn't 
 evaluate to a variable, but to the result of a statement.

I'm not complaining.

-- 
Alain Williams
Linux/GNU Consultant - Mail systems, Web sites, Networking, Programmer, IT 
Lecturer.
+44 (0) 787 668 0256  http://www.phcomp.co.uk/
Parliament Hill Computers Ltd. Registration Information: 
http://www.phcomp.co.uk/contact.php
#include std_disclaimer.h

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DEV] [RFC] DateTime and Daylight Saving Time Transitions

2011-10-18 Thread Daniel Convissor
Hello!

PHP's DateTime class has unexpected outcomes when dealing with the
transitions between Daylight Saving Time and Standard Time.

Properly defining, documenting and unit testing DateTime's behaviors is
important for PHP's future. This document seeks agreement on what the
expected behaviors should be.

Please take a moment to review the RFC and post any questions or
concerns here.

https://wiki.php.net/rfc/datetime_and_daylight_saving_time

Thanks,

--Dan

-- 
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
data intensive web and database programming
http://www.AnalysisAndSolutions.com/
 4015 7th Ave #4, Brooklyn NY 11232  v: 718-854-0335 f: 718-854-0409

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] Ternary operator performance improvements

2011-10-18 Thread Stas Malyshev

Hi!

On 10/18/11 2:43 PM, Alain Williams wrote:

It probably does, but it is quite subtle. I was expecting the above to work 
since
it does in C -- although in Cvariable is an address which can be used in an
expression ... the PHP '' operator is different, in spite of apparent 
similarities.


Actually, in PHP standalone  doesn't even make any sense. PHP has 
certain operations - assignment by reference (bind two names to one 
variable) and passing by reference (which is the same thing but 
cross-scope) and returning by reference (which again is the same thing 
but in opposite direction). But unlike C there's no operation taking 
reference because while C has pointers PHP doesn't have anything like 
that.

--
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] is_a fix for 5.4 and HEAD

2011-10-18 Thread Alan Knowles
Supporting strings 'by default' in is_a() has the downside that it 
produces slightly unpredictable results. If you are accepting 'mixed' 
arguments, some of which may be strings, there is a slim chance that the 
string you accept will match the class or it's parent by accident.


Personally if I did not believe that the barrier for a  BC change has to 
be alot higher than 'prettier or consistent API', i would have suggested 
that is_subclass_of should be changed to be 'consistent', and safer.


While the old justification for using is_a() over instanceof, has almost 
gone (it was the only way to write code that was portable to  PHP4  
PHP5.*, except for the annoying depreciation message). I still consider 
is_a(), especially with negative testing slightly clearer to read than 
instanceof.


Regards
Alan

On Monday, October 17, 2011 09:22 PM, Jonathan Bond-Caron wrote:

On Sun Oct 16 06:59 PM, Stas Malyshev wrote:

It definitely makes PHP worse by propagating inconsistent APIs.

I created a patch against 5.4:
https://bugs.php.net/patch-display.php?bug_id=55475patch=is_a_5.4_alternati
verevision=latest

The patch changes the behavior to:
is_a(ab, b) // false
is_a(ab, b, true) // autoload ab, autoload b -- false

is_subclass_of(ab, b) // false
is_subclass_of(ab, b, true) // autoload ab, autoload b -- false

Both class names can be autoloaded but not by default

Thoughts?






--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php