Skip to content

Instantly share code, notes, and snippets.

@ircmaxell
Created February 20, 2015 15:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ircmaxell/48c168fe5c3166bd3b6e to your computer and use it in GitHub Desktop.
Save ircmaxell/48c168fe5c3166bd3b6e to your computer and use it in GitHub Desktop.
Check
if (file_ast->children > 0 && !(
file_ast->child[0] == ast // First statement in the file
|| ( // after a non-block namespace declaration
file_ast->child[0]->kind == ZEND_AST_NAMESPACE
&& file_ast->child[0]->child[1] == NULL // non-block mode namespace declaration
&& file_ast->child[1] == ast
))) {
zend_error_noreturn(E_COMPILE_ERROR, "Encoding declaration pragma must be "
"the very first statement in the script");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment