4 ms·
Yes, a new state is unfortunate, however a lot of PHP code uses classes as pure data classes without any constructor & with only public properties, i.e the clas
by fetbaffe 7y ago
Yes, a new state is unfortunate, however a lot of PHP code uses classes as pure data classes without any constructor & with only public properties, i.e the class functions more like a struct where you assign property values from outside the object instance. Requiring a constructor would remove a perfectly valid code pattern that is in use today.