v 3.9.0 new magic method __toString()
You mention that we can now merge DateTime objects (also objects) with the magic method __toString()
Since I am not a programmer who understands objects or methods - could you someday make an example of how to use the magic method __toString() to merge a DateTime object ?
- and what is a DateTime object ?
- and where does the DateTime object come from ?
Thanks for TBS every day (any bloke like me can do a lot of what a real programmer just does by using TBS),
Re: v 3.9.0 new magic method __toString()
It is mentioned that TBS "now can merge DateTime objects and also objects with the magic method __toString().".
But DateTime doesn't have a magic method __toString(). At least we cannot say if it has one.
DateTime is an internal PHP class provided since version 5. It enables you manage dates and times values with objects in one hand, and to expend the support of dates and times in another hand. For example, it can manage dates before 01/01/1970, that was not possible with simple date/time functions before.
__toString() is a magic method for PHP class. If you create your own class, and if you add to this class a method (i.e. a function) named __toString(), then this method will be automatically invoked when the code tries to implicitly convert the object to a string. For example, when you code: