]> granicus.if.org Git - php/commit
Allow throwing exception while loading parent class
authorNikita Popov <nikita.ppv@gmail.com>
Wed, 11 Sep 2019 13:31:04 +0000 (15:31 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Thu, 12 Sep 2019 14:41:18 +0000 (16:41 +0200)
commit4b9ebd837b6fc20bd907ae858375737e91365ede
treed3384a015615af07d26e296fca42802b8a02b750
parent679cbee870691936f7f426c0cb7ecaa70018b563
Allow throwing exception while loading parent class

This is a fix for symfony/symfony#32995.

The behavior is:

* Throwing exception when loading parent/interface is allowed
  (and we will also throw one if the class is simply not found).
* If this happens, the bucket key for the class is reset, so
  it's possibly to try registering the same class again.
* However, if the class has already been used due to a variance
  obligation, the exception is upgraded to a fatal error, as we
  cannot safely unregister the class stub anymore.
20 files changed:
Zend/tests/bug30519.phpt
Zend/tests/bug30922.phpt
Zend/tests/bug49908.phpt
Zend/tests/type_declarations/variance/loading_exception1.phpt [new file with mode: 0644]
Zend/tests/type_declarations/variance/loading_exception2.phpt [new file with mode: 0644]
Zend/tests/type_declarations/variance/unlinked_parent_1.phpt
Zend/tests/type_declarations/variance/unlinked_parent_2.phpt
Zend/tests/use_unlinked_class.phpt
Zend/zend_compile.c
Zend/zend_compile.h
Zend/zend_execute_API.c
Zend/zend_inheritance.c
Zend/zend_inheritance.h
Zend/zend_vm_def.h
Zend/zend_vm_execute.h
ext/opcache/ZendAccelerator.c
ext/spl/tests/bug73423.phpt
tests/classes/autoload_010.phpt
tests/classes/autoload_011.phpt
tests/classes/bug75765.phpt