mirror of
https://github.com/php/php-src.git
synced 2024-09-23 10:57:26 +00:00
5d869df753
Throw a compile error for "static" references instead, where it isn't already the case. Also extract the code that does that -- we have quite a few places where we get a const class ref and require it to be default.
18 lines
309 B
PHP
18 lines
309 B
PHP
--TEST--
|
|
Cannot catch "static"
|
|
--FILE--
|
|
<?php
|
|
|
|
// This could in principle be supported, but isn't right now.
|
|
class Test {
|
|
public function method() {
|
|
try {
|
|
foo();
|
|
} catch (static $e) {}
|
|
}
|
|
}
|
|
|
|
?>
|
|
--EXPECTF--
|
|
Fatal error: Bad class name in the catch statement in %s on line %d
|