mirror of
https://github.com/php/php-src.git
synced 2024-09-21 18:07:23 +00:00
Merge branch 'PHP-7.0'
This commit is contained in:
commit
42252f409b
@ -13,10 +13,10 @@ trait T {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class Bar extends Foo
|
class B extends Foo
|
||||||
{
|
{
|
||||||
use T;
|
use T;
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
--EXPECTF--
|
--EXPECTF--
|
||||||
Strict Standards: Declaration of T::bar() should be compatible with Foo::bar($a = 'Foo') in %sbug70957.php on line %d
|
Warning: Declaration of T::bar() should be compatible with Foo::bar($a = 'Foo') in %sbug70957.php on line %d
|
||||||
|
21
Zend/tests/bug70958.phpt
Normal file
21
Zend/tests/bug70958.phpt
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
--TEST--
|
||||||
|
Bug #70958 (Invalid opcode while using ::class as trait method paramater default value)
|
||||||
|
--FILE--
|
||||||
|
<?php
|
||||||
|
trait Foo
|
||||||
|
{
|
||||||
|
function bar($a = self::class) {
|
||||||
|
var_dump($a);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class B {
|
||||||
|
use Foo;
|
||||||
|
}
|
||||||
|
|
||||||
|
$b = new B;
|
||||||
|
|
||||||
|
$b->bar();
|
||||||
|
?>
|
||||||
|
--EXPECT--
|
||||||
|
string(1) "B"
|
@ -7665,10 +7665,13 @@ void zend_eval_const_expr(zend_ast **ast_ptr) /* {{{ */
|
|||||||
|
|
||||||
if (zend_try_compile_const_expr_resolve_class_name(&result, class_ast, name_ast, 0)) {
|
if (zend_try_compile_const_expr_resolve_class_name(&result, class_ast, name_ast, 0)) {
|
||||||
if (Z_TYPE(result) == IS_NULL) {
|
if (Z_TYPE(result) == IS_NULL) {
|
||||||
|
if (zend_get_class_fetch_type(zend_ast_get_str(class_ast)) == ZEND_FETCH_CLASS_SELF) {
|
||||||
|
zend_ast_destroy(ast);
|
||||||
|
*ast_ptr = zend_ast_create_ex(ZEND_AST_MAGIC_CONST, T_CLASS_C);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
} else {
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
zend_eval_const_expr(&class_ast);
|
zend_eval_const_expr(&class_ast);
|
||||||
|
Loading…
Reference in New Issue
Block a user