| Antony Dovgal 2006-08-28, 7:56 am |
| tony2001 Mon Aug 28 10:25:49 2006 UTC
Added files:
/ZendEngine2/tests bug38624.phpt
Modified files:
/ZendEngine2 zend_interfaces.c
Log:
fix #38624 (Strange warning when incrementing an object property and exception is thrown from __get method)
http://cvs.php.net/viewvc.cgi/ZendE...5&diff_format=u
Index: ZendEngine2/zend_interfaces.c
diff -u ZendEngine2/zend_interfaces.c:1.54 ZendEngine2/zend_interfaces.c:1.55
--- ZendEngine2/zend_interfaces.c:1.54 Wed May 31 18:59:42 2006
+++ ZendEngine2/zend_interfaces.c Mon Aug 28 10:25:49 2006
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_interfaces.c,v 1.54 2006/05/31 18:59:42 tony2001 Exp $ */
+/* $Id: zend_interfaces.c,v 1.55 2006/08/28 10:25:49 tony2001 Exp $ */
#include "zend.h"
#include "zend_API.h"
@@ -93,7 +93,9 @@
if (!obj_ce) {
obj_ce = object_pp ? Z_OBJCE_PP(object_pp) : NULL;
}
- zend_error(E_CORE_ERROR, "Couldn't execute method %v%s%s", obj_ce ? obj_ce->name : EMPTY_ZSTR, obj_ce ? "::" : "", function_name);
+ if (!EG(exception)) {
+ zend_error(E_CORE_ERROR, "Couldn't execute method %v%s%s", obj_ce ? obj_ce->name : EMPTY_ZSTR, obj_ce ? "::" : "", function_name);
+ }
}
if (!retval_ptr_ptr) {
if (retval) {
http://cvs.php.net/viewvc.cgi/ZendE...=markup&rev=1.1
Index: ZendEngine2/tests/bug38624.phpt
+++ ZendEngine2/tests/bug38624.phpt
--TEST--
Bug #38624 (Strange warning when incrementing an object property and exception is thrown from __get method)
--FILE--
<?php
class impl
{
public function __construct()
{
$this->counter++;
}
public function __set( $name, $value )
{
throw new Exception( "doesn't work" );
}
public function __get( $name )
{
throw new Exception( "doesn't work" );
}
}
$impl = new impl();
echo "Done\n";
?>
--EXPECTF--
Fatal error: Uncaught exception 'Exception' with message 'doesn't work' in %s:%d
Stack trace:
#0 %s(%d): impl->__get('counter')
#1 %s(%d): impl->__construct()
#2 {main}
thrown in %s on line %d
|