[PHP-DEV] Re: Multi-level Caching Fork of OPcache -- update

2013-05-07 Thread Dmitry Stogov
Hi Terry, I don't have time right now (on this week), but I'll definitely take a look into your patch later. Thanks. Dmitry. On Sat, May 4, 2013 at 5:29 PM, Terry Ellison wrote: > Please treat this email by way of request for feedback from the OPcache > developers and anyone interested in inf

Re: [PHP-DEV] property de-referencing

2013-05-07 Thread Seva Lapsha
Good developers research and find *best* ways to use the available tools before inventing new ones. On Mon, May 6, 2013 at 2:46 PM, Rasmus Schultz wrote: > Well, I don't disagree as such - there's any number of (mostly bad) ways > to work around missing language features... > > > On Mon, May 6,

Re: [PHP-DEV] property de-referencing

2013-05-07 Thread Rasmus Schultz
And what do good developers do when the best ways have long since been identified - and the limitations of the language prevents them from implementing any new ideas? I have hundreds of PHP experiments collected in a sandbox over the years - a good way to build and handle web-forms is one of the l

Re: [PHP-DEV] property de-referencing

2013-05-07 Thread Seva Lapsha
Maybe PHP is just not for you. There are other languages in the sea :) On Tue, May 7, 2013 at 10:32 AM, Rasmus Schultz wrote: > And what do good developers do when the best ways have long since been > identified - and the limitations of the language prevents them from > implementing any new ide

Re: [PHP-DEV] property de-referencing

2013-05-07 Thread Rasmus Schultz
I have tried tons of other languages, actively watching at least a few others in the hopes they'll mature - but I keep coming back to PHP for some reason. It's an abusive relationship. Maybe I should seek counseling ;-) On Tue, May 7, 2013 at 11:15 AM, Seva Lapsha wrote: > Maybe PHP is just not

Re: [PHP-DEV] property de-referencing

2013-05-07 Thread Matthieu Napoli
I am really surprised that there is so few people interested in such a feature. IMO, it's an amazing idea, not just for forms, and not just for properties. Here is a quick list of use cases where one would use "meta" on its code: - Forms generation (examples have already been given) - ORM mapp

Re: [PHP-DEV] property de-referencing

2013-05-07 Thread Levi Morrison
> I am really surprised that there is so few people interested in such a > feature. IMO, it's an amazing idea, not just for forms, and not just for > properties. > It's not that the idea isn't useful; I just don't think I need a dedicated syntax for it. If we're going to be adding syntax I'd much

[PHP-DEV] idea: letting the line number and file name be set via user_error

2013-05-07 Thread Thomas Anderson
If you do user_error('whatever') it'll show, as the line number for that error, the line number on which that user_error() call is made. It'd be nice if you could control the line number and file name that was displayed. eg. That'll say "Notice: whatever in ... on line 4" (ie. the line that the

[PHP-DEV] idea: implement a Comparable interface

2013-05-07 Thread Thomas Anderson
It'd be nice if, when doing $objA > $objB, that that'd invoke $objA->__compareTo($objB) or something, much like Java's Comparable interface.

Re: [PHP-DEV] idea: letting the line number and file name be set via user_error

2013-05-07 Thread Ferenc Kovacs
On Tue, May 7, 2013 at 6:09 PM, Thomas Anderson wrote: > If you do user_error('whatever') it'll show, as the line number for that > error, the line number on which that user_error() call is made. It'd be > nice if you could control the line number and file name that was displayed. > eg. > > fun

Re: [PHP-DEV] idea: implement a Comparable interface

2013-05-07 Thread Levi Morrison
> It'd be nice if, when doing $objA > $objB, that that'd invoke > $objA->__compareTo($objB) or something, much like Java's Comparable > interface. > There is nothing stopping you from creating this in user-land. Also, I have spent a lot of time writing libraries in PHP and I now believe that this

Re: [PHP-DEV] idea: implement a Comparable interface

2013-05-07 Thread Levi Morrison
> It'd be nice if, when doing $objA > $objB, that that'd invoke >> $objA->__compareTo($objB) or something, much like Java's Comparable >> interface. >> > > There is nothing stopping you from creating this in user-land. Also, I > have spent a lot of time writing libraries in PHP and I now believe th

Re: [PHP-DEV] Continued try blocks

2013-05-07 Thread Seva Lapsha
The feature exists in Python: http://stackoverflow.com/questions/574730/python-how-to-ignore-an-exception-and-proceed, in Ruby: http://stackoverflow.com/questions/5089802/which-is-the-shortest-way-to-silently-ignore-a-ruby-exception. Just saying. On Wed, May 1, 2013 at 4:46 AM, Patrick ALLAERT w

Re: [PHP-DEV] idea: letting the line number and file name be set via user_error

2013-05-07 Thread Bob Weinand
Am 7.5.2013 um 18:25 schrieb Ferenc Kovacs : > On Tue, May 7, 2013 at 6:09 PM, Thomas Anderson wrote: > >> If you do user_error('whatever') it'll show, as the line number for that >> error, the line number on which that user_error() call is made. It'd be >> nice if you could control the line n

Re: [PHP-DEV] Continued try blocks

2013-05-07 Thread Stas Malyshev
Hi! > The feature exists in > Python: > http://stackoverflow.com/questions/574730/python-how-to-ignore-an-exception-and-proceed, I don't think it does what is proposed - except/pass just catches an exception and does nothing, it does not return in the place where exception was thrown down the st

Re: [PHP-DEV] idea: implement a Comparable interface

2013-05-07 Thread Adam Harvey
On 7 May 2013 09:17, Thomas Anderson wrote: > It'd be nice if, when doing $objA > $objB, that that'd invoke > $objA->__compareTo($objB) or something, much like Java's Comparable > interface. I wrote https://wiki.php.net/rfc/comparable a couple of years ago — there's a patch there that would proba

Re: [PHP-DEV] idea: implement a Comparable interface

2013-05-07 Thread Nikita Popov
On Tue, May 7, 2013 at 6:17 PM, Thomas Anderson wrote: > It'd be nice if, when doing $objA > $objB, that that'd invoke > $objA->__compareTo($objB) or something, much like Java's Comparable > interface. > Do you have examples of what this would be useful for? The two things that come to mind are

Re: [PHP-DEV] idea: implement a Comparable interface

2013-05-07 Thread Daniel Ribeiro
Its kinda useless feature for PHP. Daniel Ribeiro Gomes Pereira Twitter | Facebook | LinkedIn iPhone: +55 (48) 9111-0931 2013/5/7 Nikita Popov

Re: [PHP-DEV] idea: implement a Comparable interface

2013-05-07 Thread Stuart Langley
Classes without the ability to overload the comparison operator could be considered kinda useless as well. On Tue, May 7, 2013 at 11:11 AM, Daniel Ribeiro wrote: > Its kinda useless feature for PHP. > > > Daniel Ribeiro Gomes Pereira > Twitter | > Facebook

Re: [PHP-DEV] Scalar Type Casting Magic Methods

2013-05-07 Thread Nikita Popov
On Sat, May 4, 2013 at 5:31 PM, Oleku Konko wrote: > Quick Observations : > > I had this issue ( > http://stackoverflow.com/questions/16375331/increment-on-tostring ) and > it kept me thinking why no error was returned, then i stumble up this RFC : > https://wiki.php.net/rfc/object_cast_to_types

Re: [PHP-DEV] idea: letting the line number and file name be set via user_error

2013-05-07 Thread Sebastian Krebs
2013/5/7 Thomas Anderson > If you do user_error('whatever') it'll show, as the line number for that > error, the line number on which that user_error() call is made. It'd be > nice if you could control the line number and file name that was displayed. > eg. > > function test() { > user_erro

Re: [PHP-DEV] idea: letting the line number and file name be set via user_error

2013-05-07 Thread Sebastian Krebs
2013/5/7 Bob Weinand > > Am 7.5.2013 um 18:25 schrieb Ferenc Kovacs : > > > On Tue, May 7, 2013 at 6:09 PM, Thomas Anderson > wrote: > > > >> If you do user_error('whatever') it'll show, as the line number for that > >> error, the line number on which that user_error() call is made. It'd be > >

Re: [PHP-DEV] idea: implement a Comparable interface

2013-05-07 Thread Jake Bell
I proposed something similar recently in the PHP-FIG group, but decided that without the language-level ability to overload comparison operators, standardizing comparables ony using methods was not very useful. If PHP could provide a magic method for comparison that involved being able to use c

Re: [PHP-DEV] idea: letting the line number and file name be set via user_error

2013-05-07 Thread Bob Weinand
Am 7.5.2013 um 21:07 schrieb Sebastian Krebs : > > > > 2013/5/7 Bob Weinand > > Am 7.5.2013 um 18:25 schrieb Ferenc Kovacs : > > > On Tue, May 7, 2013 at 6:09 PM, Thomas Anderson wrote: > > > >> If you do user_error('whatever') it'll show, as the line number for that > >> error, the line n

Re: [PHP-DEV] idea: letting the line number and file name be set via user_error

2013-05-07 Thread Thomas Anderson
On Tue, May 7, 2013 at 2:04 PM, Sebastian Krebs wrote: > > > > 2013/5/7 Thomas Anderson > >> If you do user_error('whatever') it'll show, as the line number for that >> error, the line number on which that user_error() call is made. It'd be >> nice if you could control the line number and file

Re: [PHP-DEV] idea: implement a Comparable interface

2013-05-07 Thread Thomas Anderson
On Tue, May 7, 2013 at 1:05 PM, Nikita Popov wrote: > On Tue, May 7, 2013 at 6:17 PM, Thomas Anderson wrote: > >> It'd be nice if, when doing $objA > $objB, that that'd invoke >> $objA->__compareTo($objB) or something, much like Java's Comparable >> interface. >> > > Do you have examples of what

Re: [PHP-DEV] idea: letting the line number and file name be set via user_error

2013-05-07 Thread Adam Harvey
On 7 May 2013 12:24, Thomas Anderson wrote: > I thought half the point of OOP was to abstract away the internals and as > is the error messages don't make much sense unless you *do* consider the > internals. > > Like let's say you have a bignum library and you're doing > $fifteen->divide($zero) on

Re: [PHP-DEV] idea: letting the line number and file name be set via user_error

2013-05-07 Thread Sebastian Krebs
2013/5/7 Thomas Anderson > > > On Tue, May 7, 2013 at 2:04 PM, Sebastian Krebs wrote: > >> >> >> >> 2013/5/7 Thomas Anderson >> >>> If you do user_error('whatever') it'll show, as the line number for that >>> error, the line number on which that user_error() call is made. It'd be >>> nice if yo

Re: [PHP-DEV] idea: letting the line number and file name be set via user_error

2013-05-07 Thread Sebastian Krebs
2013/5/7 Bob Weinand > > Am 7.5.2013 um 21:07 schrieb Sebastian Krebs : > > > > > 2013/5/7 Bob Weinand > >> >> Am 7.5.2013 um 18:25 schrieb Ferenc Kovacs : >> >> > On Tue, May 7, 2013 at 6:09 PM, Thomas Anderson >> wrote: >> > >> >> If you do user_error('whatever') it'll show, as the line numbe

Re: [PHP-DEV] idea: letting the line number and file name be set via user_error

2013-05-07 Thread Thomas Anderson
On Tue, May 7, 2013 at 2:49 PM, Sebastian Krebs wrote: > 2013/5/7 Bob Weinand > > > > > Am 7.5.2013 um 21:07 schrieb Sebastian Krebs : > > > > > > > > > > 2013/5/7 Bob Weinand > > > >> > >> Am 7.5.2013 um 18:25 schrieb Ferenc Kovacs : > >> > >> > On Tue, May 7, 2013 at 6:09 PM, Thomas Anderson

Re: [PHP-DEV] idea: letting the line number and file name be set via user_error

2013-05-07 Thread Bob Weinand
Am 7.5.2013 um 21:49 schrieb Sebastian Krebs : > > > > 2013/5/7 Bob Weinand > > Am 7.5.2013 um 21:07 schrieb Sebastian Krebs : > >> >> >> >> 2013/5/7 Bob Weinand >> >> Am 7.5.2013 um 18:25 schrieb Ferenc Kovacs : >> >> > On Tue, May 7, 2013 at 6:09 PM, Thomas Anderson wrote: >> > >>

Re: [PHP-DEV] idea: letting the line number and file name be set via user_error

2013-05-07 Thread Stas Malyshev
Hi! > And today we have the problem that we cannot use in any useful manner > trigger_error in libraries, when we don't know where the error > originates from. You debug today trigger_error's in libraries with > putting a debug_print_backtrace behind the trigger_error. I think you Why not use a d

Re: [PHP-DEV] idea: letting the line number and file name be set via user_error

2013-05-07 Thread Stas Malyshev
Hi! > If you do user_error('whatever') it'll show, as the line number for that > error, the line number on which that user_error() call is made. It'd be > nice if you could control the line number and file name that was displayed. > eg. If you need additional information to accompany the error,

Re: [PHP-DEV] idea: letting the line number and file name be set via user_error

2013-05-07 Thread Thomas Anderson
On Tue, May 7, 2013 at 3:14 PM, Stas Malyshev wrote: > Hi! > > > If you do user_error('whatever') it'll show, as the line number for that > > error, the line number on which that user_error() call is made. It'd be > > nice if you could control the line number and file name that was > displayed. >

Re: [PHP-DEV] idea: implement a Comparable interface

2013-05-07 Thread Stas Malyshev
Hi! > Classes without the ability to overload the comparison operator could be > considered kinda useless as well. That's demonstrably false - classes are very useful right now in PHP yet no overloading of operators exists. -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm

Re: [PHP-DEV] idea: implement a Comparable interface

2013-05-07 Thread Stas Malyshev
Hi! > I wrote https://wiki.php.net/rfc/comparable a couple of years ago — > there's a patch there that would probably still apply without too much > work to master. About the only difference was that I didn't double > underscore the magic method (in line with both Java and PHP interfaces > like Co

Re: [PHP-DEV] idea: implement a Comparable interface

2013-05-07 Thread Daniel Ribeiro
To me, it sounds that those extremely specific cases ask for a extremely specific compareTo(stdClass) method. Daniel Ribeiro Gomes Pereira Twitter | Facebook | LinkedIn

Re: [PHP-DEV] idea: letting the line number and file name be set via user_error

2013-05-07 Thread Stas Malyshev
Hi! > So the error messages your library produces have the same consistent > look and feel to them that PHP's errors do? While it may be nice, I don't think it is worth changing the PHP API for. Error messages have very defined api, which has the place in the source where they were actually produ

Re: [PHP-DEV] idea: letting the line number and file name be set via user_error

2013-05-07 Thread Thomas Anderson
On Tue, May 7, 2013 at 3:38 PM, Stas Malyshev wrote: > Hi! > > > So the error messages your library produces have the same consistent > > look and feel to them that PHP's errors do? > > While it may be nice, I don't think it is worth changing the PHP API > for. Error messages have very defined api

Re: [PHP-DEV] idea: letting the line number and file name be set via user_error

2013-05-07 Thread Bob Weinand
Am 7.5.2013 um 22:11 schrieb Stas Malyshev : > Hi! > >> And today we have the problem that we cannot use in any useful manner >> trigger_error in libraries, when we don't know where the error >> originates from. You debug today trigger_error's in libraries with >> putting a debug_print_backtrace

Re: [PHP-DEV] idea: letting the line number and file name be set via user_error

2013-05-07 Thread Sebastian Krebs
2013/5/7 Bob Weinand > > Am 7.5.2013 um 22:11 schrieb Stas Malyshev : > > > Hi! > > > >> And today we have the problem that we cannot use in any useful manner > >> trigger_error in libraries, when we don't know where the error > >> originates from. You debug today trigger_error's in libraries wit

Re: [PHP-DEV] idea: letting the line number and file name be set via user_error

2013-05-07 Thread Thomas Anderson
On Tue, May 7, 2013 at 4:30 PM, Sebastian Krebs wrote: > 2013/5/7 Bob Weinand > > > > > Am 7.5.2013 um 22:11 schrieb Stas Malyshev : > > > > > Hi! > > > > > >> And today we have the problem that we cannot use in any useful manner > > >> trigger_error in libraries, when we don't know where the er

[PHP-DEV] [PATCH] faster and safer fpm config reading

2013-05-07 Thread Martin Pelikan
commit edae18ccf5c51ae0bcc0e9655ead7540fd42dd9f Author: Martin Pelikan Date: Wed May 8 02:06:09 2013 +0200 Faster and safer parsing of fpm configuration. The current fpm config parser did a read(2) syscall per character, which obfuscated debugging strace/ktrace output somewhat.

Re: [PHP-DEV] Scalar Type Casting Magic Methods

2013-05-07 Thread Pierre du Plessis
The __toArray can be useful if you want to perform array functions on the object (E.G array_filter), otherwise I think it would be very useful if the array functions can accept an object implementing ArrayAccess as well instead of just an array On May 7, 2013 8:40 PM, "Nikita Popov" wrote: > On S

RE: [PHP-DEV] idea: implement a Comparable interface

2013-05-07 Thread Christian Stoller
> On Tue, May 7, 2013 at 6:17 PM, Thomas Anderson wrote: > > > It'd be nice if, when doing $objA > $objB, that that'd invoke > > $objA->__compareTo($objB) or something, much like Java's Comparable > > interface. > > > > Do you have examples of what this would be useful for? The two things that > c