Say I have a class like this:
class Order {
const STATUS_INITIALIZED = 'initialized';
const STATUS_ORDERED = 'ordered';
}
and I would like to take a constant like this:
$status = $_GET['status'];
Is there a way to access the value of a constant given the name of the constant as a string?
I tried:
Order::$status
Order::$$status
source
share