mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
Merge branch 'PHP-8.2'
* PHP-8.2: Fix delayed early binding class redeclaration error
This commit is contained in:
2
Zend/tests/delayed_early_binding_redeclaration-1.inc
Normal file
2
Zend/tests/delayed_early_binding_redeclaration-1.inc
Normal file
@@ -0,0 +1,2 @@
|
||||
<?php
|
||||
class Bar extends Foo {}
|
||||
2
Zend/tests/delayed_early_binding_redeclaration-2.inc
Normal file
2
Zend/tests/delayed_early_binding_redeclaration-2.inc
Normal file
@@ -0,0 +1,2 @@
|
||||
<?php
|
||||
class Bar extends Foo {}
|
||||
13
Zend/tests/delayed_early_binding_redeclaration.phpt
Normal file
13
Zend/tests/delayed_early_binding_redeclaration.phpt
Normal file
@@ -0,0 +1,13 @@
|
||||
--TEST--
|
||||
Delayed early binding throws class redeclaration error
|
||||
--EXTENSIONS--
|
||||
opcache
|
||||
--FILE--
|
||||
<?php
|
||||
class Foo {}
|
||||
include __DIR__ . '/delayed_early_binding_redeclaration-1.inc';
|
||||
include __DIR__ . '/delayed_early_binding_redeclaration-2.inc';
|
||||
var_dump(class_exists(Bar::class));
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Cannot declare class Bar, because the name is already in use in %sdelayed_early_binding_redeclaration-2.inc on line %d
|
||||
@@ -363,9 +363,9 @@ static void zend_accel_do_delayed_early_binding(
|
||||
ce = zend_try_early_bind(orig_ce, parent_ce, early_binding->lcname, zv);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ce && early_binding->cache_slot != (uint32_t) -1) {
|
||||
*(void**)((char*)run_time_cache + early_binding->cache_slot) = ce;
|
||||
if (ce && early_binding->cache_slot != (uint32_t) -1) {
|
||||
*(void**)((char*)run_time_cache + early_binding->cache_slot) = ce;
|
||||
}
|
||||
}
|
||||
}
|
||||
CG(compiled_filename) = orig_compiled_filename;
|
||||
|
||||
Reference in New Issue
Block a user