Improved fix for bug #41633 (self:: doesn't work for constants) to support function define()

This commit is contained in:
Dmitry Stogov 2007-07-27 16:29:25 +00:00
parent addd8f592d
commit b5ccc03fc2
2 changed files with 13 additions and 1 deletions

12
Zend/tests/bug41633_4.phpt Executable file
View File

@ -0,0 +1,12 @@
--TEST--
Bug #41633.4 (self:: doesn't work for constants)
--FILE--
<?php
class Foo {
const A = self::B;
const B = "ok";
}
var_dump(defined("Foo::A"));
?>
--EXPECT--
bool(true)

View File

@ -348,7 +348,7 @@ ZEND_API int zend_u_get_constant(zend_uchar type, zstr name, uint name_len, zval
efree(class_name.v);
if (retval) {
zval_update_constant(ret_constant, (void*)1 TSRMLS_CC);
zval_update_constant_ex(ret_constant, (void*)1, *ce TSRMLS_CC);
*result = **ret_constant;
zval_copy_ctor(result);
}