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