xref: /PHP-8.0/Zend/tests/bug61011.phpt (revision f8d79582)
1--TEST--
2Bug #61011 (Crash when an exception is thrown by autoloader accessing a static property)
3--FILE--
4<?php
5spl_autoload_register(function ($name) {
6    throw new Exception($name);
7});
8
9try {
10    echo AAA::$a; //zend_fetch_var_address_helper
11} catch (Exception $e) {
12    try {
13        echo AAA::XXX; //ZEND_FETCH_CONSTANT
14    } catch (Exception $e) {
15        try {
16            echo AAA::foo(); //ZEND_INIT_STATIC_METHOD_CALL
17        } catch (Exception $e) {
18            try  {
19                unset(AAA::$a); // ZEND_UNSET_VAR
20            } catch (Exception $e){
21                try {
22                    isset(AAAA::$a); // ZEND_ISSET_ISEMPTY_VAR
23                } catch (Exception $e) {
24                    try  {
25                        $a = array("AAA", "foo");
26                        $a(); //ZEND_INIT_FCALL_BY_NAME
27                    } catch (Exception $e) {
28                    }
29                }
30            }
31        }
32    }
33}
34echo 'okey';
35--EXPECT--
36okey
37