Skip to content

Instantly share code, notes, and snippets.

@maetl
Created September 27, 2011 13:57
Show Gist options
  • Select an option

  • Save maetl/1245106 to your computer and use it in GitHub Desktop.

Select an option

Save maetl/1245106 to your computer and use it in GitHub Desktop.
PHP Reserved Words
<?php
function is_reserved_word($word)
{
return (in_array($word, array(
"abstract",
"and",
"array",
"as",
"break",
"case",
"catch",
"class",
"clone",
"do",
"else",
"elseif",
"enddeclare",
"endfor",
"endforeach",
"endif",
"endswitch",
"endwhile",
"extends",
"final",
"for",
"foreach",
"function",
"global",
"goto",
"if",
"implements",
"interface",
"instanceof",
"namespace",
"new",
"or",
"private",
"protected",
"public",
"static",
"switch",
"throw",
"try",
"use",
"var",
"while",
"xor",
"die",
"echo",
"empty",
"exit",
"eval",
"include",
"include_once",
"isset",
"list",
"require",
"require_once",
"return",
"print",
"unset",
)));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment