The following would work in PHP 5.3, but not in PHP 5.4.10.
throw new Custom_Exception();
class Custom_Exception extends Exception {}
PHP 5.4.10 would respond with the following fatal error:
Class 'Custom_Exception' not found in ...
Does anyone know why?
p.s. Moving the class definition above the throw statement fixes it.
1917-1918↑ Military disintegration and unwillingness to fight, mixed, in the later stages of the war, with growing vocal, ideological and politicized opposition to the very nature and existence of the conflict.
Initially, Australian men volunteered to enlist for different reasons, because they: needed regular pay. sought combat or adventure. wanted to escape from normal life.
What are people's perceptions of war in 1914? What were their expectations? People thought marching off to war would be fun or romantic so young men signed up without a second thought. Everyone thought it would be over by Christmas since they believed troops would fight in an open field.
I put your code into a file called test.php, and downloaded php-5.4.10
When I execute:
php -c php.ini-development -f test.php
I see the following output:
PHP Fatal error: Uncaught exception 'Custom_Exception' in test.php:3
Stack trace:
#0 {main}
thrown in test.php on line 3
Fatal error: Uncaught exception 'Custom_Exception' in test.php:3
Stack trace:
#0 {main}
thrown in test.php on line 3
I believe you have a configuration issue. Are you testing from the command-line?
Edit:
I also compared do_bind_inherited_class in zend_compile.c for both versions.
zend_compile.c from 5.3
zend_compile.c from 5.4.10
It looks like they only added support for traits.
My answer is: No, I do not believe the attitude has changed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With