Doc #51758 [NEW]: zend_object_handlers.h prescribes incorrect behavior of write property handler
From: cataphract
Operating system: Not applicable
PHP version: 5.3.2
Package: Class/Object related
Bug Type: Documentation Problem
Bug description:zend_object_handlers.h prescribes incorrect behavior of write property handler
Description:
------------
zend_object_handler.h reads (line 39):
/* The following rule applies to write_property() and write_dimension()
implementations:
If you receive a value zval in write_property/write_dimension, you may
only modify it if
its reference count is 1. Otherwise, you must create a copy of that
zval before making
any changes. You should NOT modify the reference count of the value
passed to you. */
Perhaps I'm reading the last phrase out of context, but
zend_std_write_property() changes the reference count of the passed value
in multiple places.
Test script:
---------------
Not applicable.
Expected result:
----------------
Expected either no prescription for the refcount of the passed value not to
be changed or the refcount of the passed value actually not be changed.
Actual result:
--------------
The implementation and the header prescription are inconsistent.
--
Edit bug report at http://bugs.php.net/bug.php?id=51758&edit=1
--
Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=51758&r=trysnapshot52
Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=51758&r=trysnapshot53
Try a snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=51758&r=trysnapshot60
Fixed in SVN: http://bugs.php.net/fix.php?id=51758&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=51758&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=51758&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=51758&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=51758&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=51758&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=51758&r=support
Expected behavior: http://bugs.php.net/fix.php?id=51758&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=51758&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=51758&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=51758&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=51758&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=51758&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=51758&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=51758&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=51758&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=51758&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=51758&r=mysqlcfg
Thread (2 messages)
- cataphract@php.net