Skip to content

Instantly share code, notes, and snippets.

@bxt
Created July 20, 2011 12:51
Show Gist options
  • Save bxt/1094897 to your computer and use it in GitHub Desktop.
Save bxt/1094897 to your computer and use it in GitHub Desktop.
PHP Namespace test file

README for PHP Namespace test file

This is just a little script, which can tell you if your hoster/php verion supports namespaces. Upload to your htdocs/webroot and naviagte your browser to the page. It might tell you "Namespaces seem to work!" or something like "Parse error: syntax error, unexpected T_STRING in /var/www/httpdocs/nst.php on line 1"

<?php namespace foo;
abstract class Bar {
public static function e() {
echo "Namespaces seem to work!";
}
}
\foo\Bar::e();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment