ID:               34078
 Updated by:       [EMAIL PROTECTED]
 Reported By:      leon at lost dot co dot nz
-Status:           Assigned
+Status:           Closed
 Bug Type:         Scripting Engine problem
 Operating System: Debian Sarge (2.6.12 kernel)
 PHP Version:      5CVS-2005-08-11 (dev)
 Assigned To:      tony2001
 New Comment:

This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.




Previous Comments:
------------------------------------------------------------------------

[2005-08-11 23:22:38] leon at lost dot co dot nz

As Homer would say: Woo-hoo! You absolutely rock!  I just can't wait
for the next 5.1 snapshot...  :-)

------------------------------------------------------------------------

[2005-08-11 23:18:55] [EMAIL PROTECTED]

Okay, I discussed it with Marcus and committed the fix to 5.0 & 5.1
branches.
I'll commit it to 6.0 too when I'll be able to do it.

------------------------------------------------------------------------

[2005-08-11 22:47:22] leon at lost dot co dot nz

Great work!  

I can understand you having to wait to merge into the 5.5/6.0 series,
but it would be great if the fix could be pushed into just the 5.1 tree
before the next release (beta4? rc4?).

We -- like many other companies -- are waiting for the 5.1 release to
move everything from PHP4 to PHP5.  Unfortunately this bug is a 'show
stopper' for us right now.

------------------------------------------------------------------------

[2005-08-11 12:50:22] [EMAIL PROTECTED]

The fix is ready, but we have to wait for Andrey & Dmitry to finish
merging of Unicode patches.

------------------------------------------------------------------------

[2005-08-11 03:37:24] leon at lost dot co dot nz

Description:
------------
This problem came up when moving our homebrew 'PHPDoc' type class to
PHP5.1.  When built with --enable-debug PHP throws up warnings up when
the class to be documented ('A' below) contains methods with default
values that are either NULL or boolean  

In the code snippet below we get two warnings, one for each default
parameter.  Changing the default values to a string or number (even
zero) eliminates the warnings.

This is a serious problem for us.  When documenting some of our bigger
classes we have seen lots of 'odd' behaviour, including permanent 100%
CPU usage by Apache!  It has taken *days* to track down the problem to
the snippet below.  If there is anything elso I can do to help fix it
please let me know...

Reproduce code:
---------------
$r = new ReflectionClass('A');
$methods = $r->getMethods();
foreach($methods as $method)
{
        $parameters = $method->getParameters();
        foreach($parameters as $p)
        {
                if($p->isDefaultValueAvailable())
                        $p->getDefaultValue();
        }
}

class A
{
        function foo($p=null, $q=false)
        {
        }
}

Expected result:
----------------
No output at all -- I've trimed all the output code out.

Actual result:
--------------
$ php bug2.php
Warning: String is not zero-terminated (ZZZZZÌ*) (source:
/tmp/php5-200508110030/Zend/zend_variables.h:35) in Unknown on line 0
[Thu Aug 11 13:18:58 2005]  Script:  'bug2.php'
---------------------------------------
/tmp/php5-200508110030/Zend/zend_variables.h(35) : Block 0x08514F30
status:
/tmp/php5-200508110030/Zend/zend_variables.c(36) : Actual location
(location was relayed)
Beginning:      Cached (allocated on Zend/zend_language_scanner.c:4689,
5 bytes)
      End:      OK
---------------------------------------

Warning: String is not zero-terminated (ZZZZZZÌ*) (source:
/tmp/php5-200508110030/Zend/zend_variables.h:35) in Unknown on line 0
[Thu Aug 11 13:18:58 2005]  Script:  'bug2.php'
---------------------------------------
/tmp/php5-200508110030/Zend/zend_variables.h(35) : Block 0x085150C8
status:
/tmp/php5-200508110030/Zend/zend_variables.c(36) : Actual location
(location was relayed)
Beginning:      Cached (allocated on Zend/zend_language_scanner.c:4689,
6 bytes)
      End:      OK
---------------------------------------




------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=34078&edit=1

Reply via email to