KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I have a class with the following schema class MyClass { const x = 'abc'; const y = '123'; function _contruct() {} } Is there any way for me to have the constants remain unset in the class body, and be set dynamically after the constructor has been called? E.g something like this: class MyClass { const x; const y; function _contruct() { $this->setStuff(); } function setStuff() { $this->x = Config::getX(); $this->y = Config::getY(); } }
Tags (comma-separated)
Save Edits
Cancel