Voting

: min(three, seven)?
(Example: nine)

The Note You're Voting On

adam at adamhahn dot com
12 years ago
This function is namespace sensitive when calling class constants.

Using:
<?php namespace sub;

class
foo {
const
BAR = 'Hello World';
}

constant('foo::BAR'); // Error

constant('sub\foo::BAR'); // works

?>

This does not seem to affect constants defined with the 'define' function. Those all end up defined in the root namespace unless another namespace is implicitly defined in the string name of the constant.

<< Back to user notes page

To Top