mirror of
https://github.com/php/php-src.git
synced 2025-01-20 10:43:40 +08:00
Improved fix for bug #41633 (self:: doesn't work for constants) to support function define()
This commit is contained in:
parent
addd8f592d
commit
b5ccc03fc2
12
Zend/tests/bug41633_4.phpt
Executable file
12
Zend/tests/bug41633_4.phpt
Executable 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)
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user