From:             piotrek dot pokora at gmail dot com
Operating system: debian/linux
PHP version:      5.2.1
PHP Bug Type:     Variables related
Bug description:  object's read property handler not used in 
zend_print_zval_r_ex

Description:
------------
zend_print_zval_r_ex uses object's get_properties handler and prints
properties HashTable without using read_property handler.

For custom object handlers hooks it means that get_properties should be
also implemented as hook which leads to too much overloaded implementation
as get_properties seems to be invoked for read and write hooks.

Taking performance into account , one would sacrifice performance problem
for print_r ( which is not used in real production environment ) which
could use object's read_property handler hook. 

Reproduce code:
---------------
Implement read and write property hooks for object.
Assuming that property's data is set in C extension one is able to call:

echo $object->prop; 

which prints property's value, while 

print_r($object);

prints object's properties without values. 

I know I can implement own get_properties hook , but unfortunatelly I can
not find suitable docs for such implementation.

I think one should be able to reproduce it with mysqli extension which
implement only get and read property hooks.


-- 
Edit bug report at http://bugs.php.net/?id=40477&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=40477&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=40477&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=40477&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=40477&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=40477&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=40477&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=40477&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=40477&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=40477&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=40477&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=40477&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=40477&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=40477&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=40477&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=40477&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=40477&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=40477&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=40477&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=40477&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=40477&r=mysqlcfg

Reply via email to