mirror of
https://github.com/php/php-src.git
synced 2024-09-22 18:37:25 +00:00
catch operator shouldn't call __autoload () too
This commit is contained in:
parent
90b45fcbbd
commit
a082983adb
4
NEWS
4
NEWS
@ -2,8 +2,8 @@ PHP NEWS
|
|||||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||
?? ??? ????, PHP 6.0
|
?? ??? ????, PHP 6.0
|
||||||
- Unicode support. (Andrei, Dmitriy, et al)
|
- Unicode support. (Andrei, Dmitriy, et al)
|
||||||
- Changed "instanceof" operator, is_a() and is_subclass_of() functions to not
|
- Changed "instanceof" and "catch" operators, is_a() and is_subclass_of()
|
||||||
call __autoload(). (Dmitry)
|
functions to not call __autoload(). (Dmitry)
|
||||||
- Added optional parameter to http_build_query() to allow specification of
|
- Added optional parameter to http_build_query() to allow specification of
|
||||||
string separator.
|
string separator.
|
||||||
- cURL improvements: (Ilia)
|
- cURL improvements: (Ilia)
|
||||||
|
23
Zend/tests/catch.phpt
Executable file
23
Zend/tests/catch.phpt
Executable file
@ -0,0 +1,23 @@
|
|||||||
|
--TEST--
|
||||||
|
catch shouldn't call __autoload
|
||||||
|
--FILE--
|
||||||
|
<?php
|
||||||
|
function __autoload($name) {
|
||||||
|
echo("AUTOLOAD '$name'\n");
|
||||||
|
eval("class $name {}");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
try {
|
||||||
|
} catch (A $e) {
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
throw new Exception();
|
||||||
|
} catch (B $e) {
|
||||||
|
} catch (Exception $e) {
|
||||||
|
echo "ok\n";
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
--EXPECT--
|
||||||
|
ok
|
@ -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));
|
long catch_op_number = get_next_op_number(CG(active_op_array));
|
||||||
zend_op *opline;
|
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 = get_next_op(CG(active_op_array) TSRMLS_CC);
|
||||||
opline->opcode = ZEND_CATCH;
|
opline->opcode = ZEND_CATCH;
|
||||||
opline->op1 = *catch_class;
|
opline->op1 = *catch_class;
|
||||||
|
Loading…
Reference in New Issue
Block a user