php-src/Zend/tests/function_outside_namespace.phpt
Nikita Popov c5f93d191e Fix detection of code outside namespace
Due to improvements to early binding, the opcode based check is
no longer accurate. Reuse the syntactic check we're already using
for declares instead.
2020-09-21 12:37:44 +02:00

13 lines
284 B
PHP

--TEST--
Function declaration should not be allowed before namespace declaration
--FILE--
<?php
function foo() {}
namespace Bar;
?>
--EXPECTF--
Fatal error: Namespace declaration statement has to be the very first statement or after any declare call in the script in %s on line %d