Re: [PHP-DEV] Trapping "memory exhausted" error

2007-04-16 Thread Peter Hodge
Hello, A soft memory limit could be very useful; it doesn't necessarily need to throw an error, but it would provide an opportunity to free some memory and prevent the script from crashing. Perhaps something like: // function to call when memory is running out register_memory_limit_handler('

Re: [PHP-DEV] PATCH: anonymous functions in PHP

2007-03-24 Thread Peter Hodge
--- Jim Wilson <[EMAIL PROTECTED]> wrote: > > Lexical anonymous functions would be enough for me. If these proposed > > lexical anonymous functions could automagically bind themselves > > to an instance's $this when called from within an object's scope (so as to > act > > as virtual methods), tha

Re: [PHP-DEV] PATCH: anonymous functions in PHP

2007-03-19 Thread Peter Hodge
--- Sean Coates <[EMAIL PROTECTED]> wrote: > > I'm not arguing the preservation of the exact value of $rev when the > > anonymous function was created (as would be the case with a closure). > > I'm thinking of the variable being whatever is defined in the parent > > regardless. As in my proposal,

RE: [PHP-DEV] Native Singleton Implementation

2007-03-06 Thread Peter Hodge
room to improve PHP's OO capabilities for PHP6, and singletons are a good start. regards, Peter > Scott > > > -Original Message- > From: Peter Hodge [mailto:[EMAIL PROTECTED] > Sent: Tuesday, 6 March 2007 3:55 PM > To: [EMAIL PROTECTED]; 'G

RE: [PHP-DEV] Native Singleton Implementation

2007-03-05 Thread Peter Hodge
Also posted in the bug report: Perhaps some nicer solutions to your got-cha's: - What happens when $members = new members() is called If the class is defined as a singleton, then PHP should create the instance as normal (this includes calling __construct() ) and store it in the hash table, or

Re: [PHP-DEV] [PROPOSAL] Change (just slightly) read/write_property() and get_property_ptr_ptr() usage

2007-02-19 Thread Peter Hodge
--- Antony Dovgal <[EMAIL PROTECTED]> wrote: > On 02/19/2007 02:23 PM, Peter Hodge wrote: > > Hello, > > > > Does that fix the problem where: > > > > $object->theArray[] = (...); > > > > is invalid when 'theArray' is implemen

Re: [PHP-DEV] [PROPOSAL] Change (just slightly) read/write_property() and get_property_ptr_ptr() usage

2007-02-19 Thread Peter Hodge
Hello, Does that fix the problem where: $object->theArray[] = (...); is invalid when 'theArray' is implemented using __get()? Whoever fixes that one could get all free drinks at PHP conferences: PHP Hacker: "Hi, I'm the guy who made it so you can add items to an array which is returned throu

[PHP-DEV] Patch: recursive call to __get() error

2006-12-21 Thread Peter Hodge
Hello, This patch for 5.2 provides an alternative error when you accidentally call __get() recursively when trying to access some property of a class. Currently, PHP says: "Notice: Undefined property: someClass::$someProperty" which makes it seem as though __get() is not called at all. This p

Re: [PHP-DEV] Feature request

2006-11-09 Thread Peter Hodge
--- Stanislav Malyshev <[EMAIL PROTECTED]> wrote: > >>> >>> function foo() > >>> { > >>>return array(1,2,3,4,5,6); > >>> } > >>> > >>> echo foo()[4]; // < it that > > It looks a bit perl-ish indeed but I don't see much trouble in having > that it people really need it... I think 'fo

Re: [PHP-DEV] How to find all PHP funtions/classes/constants

2006-10-29 Thread Peter Hodge
--- Derick Rethans <[EMAIL PROTECTED]> wrote: > On Sat, 28 Oct 2006, Peter Hodge wrote: > > > Hello everyone, > > > > I am in the process of updating the PHP syntax file for Vim, and I need to > > gather a list of all built-in PHP functions, constants, class

[PHP-DEV] How to find all PHP funtions/classes/constants

2006-10-27 Thread Peter Hodge
Hello everyone, I am in the process of updating the PHP syntax file for Vim, and I need to gather a list of all built-in PHP functions, constants, classes, interfaces, and preferably also the methods and class-constants from said built-in classes and interfaces. First I used my PHP's get_defined_