mirror of
https://github.com/php/php-src.git
synced 2024-12-19 15:00:15 +08:00
56f1106162
This does not collide with NO_AUTOLOAD -- missing classes will be silenced, but invalid use of self etc will result in an exception instead of a fatal error.
18 lines
268 B
PHP
18 lines
268 B
PHP
--TEST--
|
|
instanceof self outside a class
|
|
--FILE--
|
|
<?php
|
|
|
|
$fn = function() {
|
|
try {
|
|
new stdClass instanceof self;
|
|
} catch (Error $e) {
|
|
echo $e->getMessage(), "\n";
|
|
}
|
|
};
|
|
$fn();
|
|
|
|
?>
|
|
--EXPECT--
|
|
Cannot access self:: when no class scope is active
|