Is there any official/recommended way to declare/define/register a new class at runtime in PHP?
What I basically want to do is generating Classes based on the definition stored in a database, both properties and methods.
I have found some article/threads, but all of them are actually old, so I was wondering if it exists some elegant/efficient way to do it. My surprise is that there is no so much information about this as I thought.
Is it so bad? As far as I know, PHP always saves the class definition in memory so I don't see any problem in declaring the class at runtime as it's basically the same result, but maybe I'm wrong.
I think is not relevant right now, but I'm working with Laravel in this project.
Thanks!