zend_hash_graceful_reverse_destroy(&EG(symbol_table));
zend_hash_init(&EG(symbol_table), 0, NULL, ZVAL_PTR_DTOR, 0);
- preload_link();
+ /* Inheritance errors may be thrown during linking */
+ zend_try {
+ preload_link();
+ } zend_catch {
+ ret = FAILURE;
+ goto finish;
+ } zend_end_try();
+
preload_remove_empty_includes();
/* Don't preload constants */
zend_shared_alloc_destroy_xlat_table();
}
+finish:
zend_hash_destroy(preload_scripts);
efree(preload_scripts);
preload_scripts = NULL;
--- /dev/null
+--TEST--
+Handling of errors during linking
+--INI--
+opcache.enable=1
+opcache.enable_cli=1
+opcache.optimization_level=-1
+opcache.preload={PWD}/preload_inheritance_error_ind.inc
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+echo "Foobar\n";
+?>
+--EXPECT--
+Fatal error: Declaration of B::foo($bar) must be compatible with A::foo() in Unknown on line 0