The case:
I have a form class which handles HTML forms, cleans up fields and validates.
I’m thinking about creating separate classes for the different form fields, e.g.: text / file / select / etc.
The way I’m considering to use this is something like the following:
$form = new Form();
$form->element['fieldname'] = new HtmlTextField('length'=>3);
However someone here on SO told me once that a class construct should never return anything.
In the above case it would return the form field.
Is it correct that a __construct() should never return anything?
Even more so: whatever you return is discarded, and a new instance of the called object is just the return.