diff --git a/NEWS b/NEWS index 418dade9288..b2beb682ab0 100644 --- a/NEWS +++ b/NEWS @@ -2,8 +2,8 @@ PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ?? ??? ????, PHP 6.0 - Unicode support. (Andrei, Dmitriy, et al) -- Changed "instanceof" operator, is_a() and is_subclass_of() functions to not - call __autoload(). (Dmitry) +- Changed "instanceof" and "catch" operators, is_a() and is_subclass_of() + functions to not call __autoload(). (Dmitry) - Added optional parameter to http_build_query() to allow specification of string separator. - cURL improvements: (Ilia) diff --git a/Zend/tests/catch.phpt b/Zend/tests/catch.phpt new file mode 100755 index 00000000000..0ec5cf75901 --- /dev/null +++ b/Zend/tests/catch.phpt @@ -0,0 +1,23 @@ +--TEST-- +catch shouldn't call __autoload +--FILE-- + +--EXPECT-- +ok diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index 606e4a9090d..fa25254a98f 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -1791,6 +1791,13 @@ void zend_do_begin_catch(znode *try_token, znode *catch_class, znode *catch_var, long catch_op_number = get_next_op_number(CG(active_op_array)); zend_op *opline; + if (catch_op_number > 0) { + opline = &CG(active_op_array)->opcodes[catch_op_number-1]; + if (opline->opcode == ZEND_FETCH_CLASS) { + opline->extended_value |= ZEND_FETCH_CLASS_NO_AUTOLOAD; + } + } + opline = get_next_op(CG(active_op_array) TSRMLS_CC); opline->opcode = ZEND_CATCH; opline->op1 = *catch_class;