What i am trying to work out is it bad practice instantiate a class like
new Classname();
As i need to run the classes __construct but i do not need to use the class past that. as other functions within the class will be called from the __construct.
It’d work, but, as someone maintaining your code, I’d be super confused by that. Generally, merely instantiating an object has no side-effects, so I’d assume that I could just delete that line and everything would still work fine.
I’d recommend reconsidering your code’s structure, since putting code with side-effects in
__constructis definitely not standard.