Description
For instance I have a class with public constant
class SomeClass
{
public const int STATUS_ACTIVE = 1;
}
And I want to use the class constant in a string.Currently I have to use concatenation or assign the class constant's value to a variable and interpolate it in the string
// option 1
$query = QueryBuilder::where('status = ' . SomeClass::STATUS_ACTIVE);
// option 2
$statusValue = SomeClass::STATUS_ACTIVE;
$query = QueryBuilder::where("status = {$statusValue}");
Would be cool and convenient to be able use interpolation for constants as well.
$query = QueryBuilder::where("status = {SomeClass::STATUS_ACTIVE}")