Re: print_r unaware of object's read_property handler

From: Date: Thu, 15 Feb 2007 11:27:38 +0000
Subject: Re: print_r unaware of object's read_property handler
References: 1  Groups: php.pecl.dev 
Request: Send a blank email to pecl-dev+get-4514@lists.php.net to get a copy of this message
On 02/15/2007 01:48 PM, Piotr Pokora wrote:
Hi! Can anyone explain me why function like print_r is not aware of object's read_property handler? What's the purpose of printing hash instead of using object's read_property standard handler or hook? When read_property hook is used then , and when it's ignored? What read_property handler hook should do , if it's ignored in functions like print_r?
In order to use read_property() you need to know the name of the property. print_r() and var_dump() output all properties of the object, they do not know their names, they have only the object itself. Therefor you need to implement get_properties() hook to return a hash table with all object properties. Which part of this explanation is not clear to you? -- Wbr, Antony Dovgal

« previous php.pecl.dev (#4514) next »