How do I initialize a PHP class by passing a parameter at the same time. Same as PDO that is initialized by passing parameters as data for the connection to the database.
In my case I want to simply pass an ID on startup. Ex:
$user = new User($id);
And after passing the parameter using the construct function to load all information from that user, without the need to call some function manually for such an action.