php-src/Zend/tests/self_class_const_outside_class.phpt
Nikita Popov 6ef8ae65a2 Allow self etc in eval / file scope
This fixes a regression from 16a9bc1ec2.
Together with the recent closure related changes this should allow
all usages of self etc, while previously (in PHP 5) some things like
self::class did not work.
2015-05-07 15:38:16 +02:00

11 lines
201 B
PHP

--TEST--
Accessing self::FOO in a free function
--FILE--
<?php
function test() {
var_dump(self::FOO);
}
?>
--EXPECTF--
Fatal error: Cannot use "self" when no class scope is active in %s on line %d