Re: [PHP-DEV] [PATCH] default session serialization

2009-11-21 Thread Michael Shadle
On Sat, Nov 21, 2009 at 9:16 PM, Arpad Ray wrote: > However it would be a significant BC break, as old serialized session > records would be unreadable after upgrading. We could mitigate this by > providing a script to convert old session files. I would say just a note saying "old session files

[PHP-DEV] [PATCH] default session serialization

2009-11-21 Thread Arpad Ray
Hi, Attached is a patch (against HEAD) which adapts the default ("php") session serializer to serialize the whole array using php_var_serialize instead of calling it once per element. This simplifies the serialization code, and allows unicode session keys, or even ascii keys containing the pipe c

[PHP-DEV] [PATCH] session_set_save_handler(class)

2009-11-21 Thread Arpad Ray
Attached is a patch (against HEAD, includes tests) which allows users to extend any session handler in an object oriented fashion. By extending the new internal class SessionHandler, users can wrap or override methods of whatever session handler is in use, or implement a complete custom handler.

Re: [PHP-DEV] suggestion about ternary operator

2009-11-21 Thread Alban
Le Sat, 21 Nov 2009 19:52:30 -0800, Rasmus Lerdorf a écrit : > > Or better yet, have your filter function return false if the variable > doesn't exist and use the ternary to set the default. You can do it all > in a single step then. > > $var = filter_func($_GET,'foo')?:42; > > Simple and clea

Re: [PHP-DEV] suggestion about ternary operator

2009-11-21 Thread Rasmus Lerdorf
Alban wrote: > Le Sat, 21 Nov 2009 10:21:18 -0800, Rasmus Lerdorf a écrit : >> The ternary isn't meant to solve the isset thing you are talking about. >> It is simply a shortcut to normal ternary operations. The most common >> case where you don't know if a variable is set is on the initial input

Re: [PHP-DEV] suggestion about ternary operator

2009-11-21 Thread Alban
Le Sat, 21 Nov 2009 10:21:18 -0800, Rasmus Lerdorf a écrit : > > The ternary isn't meant to solve the isset thing you are talking about. > It is simply a shortcut to normal ternary operations. The most common > case where you don't know if a variable is set is on the initial input > via $_GET or

Re: [PHP-DEV] suggestion about ternary operator

2009-11-21 Thread D. Dante Lorenso
Lukas Kahwe Smith wrote: On 21.11.2009, at 22:29, Dante Lorenso wrote: I would love to restate my recommendation for the function "filled". Which is the opposite of "empty". Filled would accept a variable number of arguments and return the first where empty evaluates as false. Like empty, fil

Re: [PHP-DEV] suggestion about ternary operator

2009-11-21 Thread Lukas Kahwe Smith
On 21.11.2009, at 22:29, Dante Lorenso wrote: > I would love to restate my recommendation for the function "filled". > Which is the opposite of "empty". Filled would accept a variable > number of arguments and return the first where empty evaluates as > false. > > Like empty, filled would not t

Re: [PHP-DEV] suggestion about ternary operator

2009-11-21 Thread Dante Lorenso
I would love to restate my recommendation for the function "filled". Which is the opposite of "empty". Filled would accept a variable number of arguments and return the first where empty evaluates as false. Like empty, filled would not throw notices for undefined variables. This is not the same a

[PHP-DEV] NEWS out of sync..

2009-11-21 Thread Jani Taskinen
Hi Johannes, You did forget something: merging back the NEWS stuff to PHP_5_3/NEWS which has this note: ?? ??? 2009, PHP 5.3.1 # Will be merged in from branches/PHP_5_3_1 once released # Pleas add stuff under 5.3.2 The next release, can we do it like Ilia does them? The way this process was

Re: [PHP-DEV] suggestion about ternary operator

2009-11-21 Thread mm w
More interesting behaviors to dig are there: variable = ?? ; variable = ? : ?? ; or a la javascript variable = || ; Best, On Sat, Nov 21, 2009 at 10:21 AM, Rasmus Lerdorf wrote: > Alban wrote: >> Le Sat, 21 Nov 2009 09:48:10 +0100, Lukas Kahwe Smith a écrit : >> >>> On 21.11.2009, at 0

Re: [PHP-DEV] suggestion about ternary operator

2009-11-21 Thread Rasmus Lerdorf
Alban wrote: > Le Sat, 21 Nov 2009 09:48:10 +0100, Lukas Kahwe Smith a écrit : > >> On 21.11.2009, at 06:12, Alban wrote: >> >>> This is not a big problem but if a solution exists, this would be so >>> cool ! Especialy when we have to check existance of twenty or more key >>> in array. Code would

Re: [PHP-DEV] suggestion about ternary operator

2009-11-21 Thread Alban
Le Sat, 21 Nov 2009 09:48:10 +0100, Lukas Kahwe Smith a écrit : > On 21.11.2009, at 06:12, Alban wrote: > >> This is not a big problem but if a solution exists, this would be so >> cool ! Especialy when we have to check existance of twenty or more key >> in array. Code would be be lighter and cle

Re: [PHP-DEV] The inconsistencies/flaws of PHP5's object model

2009-11-21 Thread Lukas Kahwe Smith
On 18.11.2009, at 09:23, Jingcheng Zhang wrote: > Hello internals, > > I've just occured a syntax problem in the following script: > > class C { >public $n = 1; > } > $o = new C(); > $o->f = function () use ($o) { >echo $o->n; > }; > $o->f(); > ?> > > The result of this script is "Fat

Re: [PHP-DEV] Re: PHP6's future

2009-11-21 Thread Lukas Kahwe Smith
On 18.11.2009, at 02:24, Greg Beaver wrote: > What needs to happen is for developers to focus on finding problems > highlighted by failing .phpt tests. The most complex extension that > needs some loving is the SPL extension. I would hazard a guess that if > these .phpt tests are fixed, a large

Re: [PHP-DEV] suggestion about ternary operator

2009-11-21 Thread Lukas Kahwe Smith
On 21.11.2009, at 06:12, Alban wrote: > This is not a big problem but if a solution exists, this would be so > cool ! Especialy when we have to check existance of twenty or more key in > array. Code would be be lighter and clear. > Since i use PHP, I always have in my 'common function file' a f