1
0
mirror of https://github.com/php/php-src.git synced 2026-04-02 21:52:36 +02:00

Merge branch 'PHP-8.0'

* PHP-8.0:
  Allow unlinked classes when performing in_compilation variance check
This commit is contained in:
Nikita Popov
2020-11-03 14:50:15 +01:00
2 changed files with 4 additions and 4 deletions

View File

@@ -239,10 +239,9 @@ static zend_bool class_visible(zend_class_entry *ce) {
static zend_class_entry *lookup_class(
zend_class_entry *scope, zend_string *name, zend_bool register_unresolved) {
zend_class_entry *ce;
uint32_t flags = ZEND_FETCH_CLASS_ALLOW_UNLINKED | ZEND_FETCH_CLASS_NO_AUTOLOAD;
zend_class_entry *ce = zend_lookup_class_ex(name, NULL, flags);
if (!CG(in_compilation)) {
uint32_t flags = ZEND_FETCH_CLASS_ALLOW_UNLINKED | ZEND_FETCH_CLASS_NO_AUTOLOAD;
ce = zend_lookup_class_ex(name, NULL, flags);
if (ce) {
return ce;
}
@@ -256,7 +255,6 @@ static zend_class_entry *lookup_class(
zend_hash_add_empty_element(CG(delayed_autoloads), name);
}
} else {
ce = zend_lookup_class_ex(name, NULL, ZEND_FETCH_CLASS_NO_AUTOLOAD);
if (ce && class_visible(ce)) {
return ce;
}

View File

@@ -14,11 +14,13 @@ class C extends Z {
public function method($a): self {}
public function method2($a): C {}
public function method3($a): object {}
public function method4(D $a) {}
}
class D extends C {
public function method($a): self {}
public function method2($a): D {}
public function method3($a): stdClass {}
public function method4(C $a) {}
}
// Works.