Associate
I was curious suppose I have an abstract class in PHP such like:
But is there a way in which I can refer to $someObject->SOME_CONST without having to call the SOME_CONST defined value?
Regards,
Code:
define("SOME_CONST",'thisisaconst');
abstract class foo {
public function myMethod() {
return (object) array (
SOME_CONST => 12
)
}
}
class bar extends foo{
public function getsomething() {
$someObject = $this->myMethod();
$someObject->SOME_CONST; // This isn't possible.
}
}
But is there a way in which I can refer to $someObject->SOME_CONST without having to call the SOME_CONST defined value?
Regards,