Skip to content

Instantly share code, notes, and snippets.

@fivestar
Created October 17, 2012 03:08
Show Gist options
  • Save fivestar/3903500 to your computer and use it in GitHub Desktop.
Save fivestar/3903500 to your computer and use it in GitHub Desktop.
<?php
namespace test {
define('FOO', 1);
const BAR = 2;
}
namespace {
var_dump(defined('FOO')); // true
var_dump(defined('test\\FOO')); // false
var_dump(defined('BAR')); // false
var_dump(defined('test\\BAR')); // true
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment