Add an interface to a class dynamically.

From: Date: Wed, 09 Mar 2016 13:59:38 +0000
Subject: Add an interface to a class dynamically.
Groups: php.general 
Request: Send a blank email to php-general+get-325454@lists.php.net to get a copy of this message
Hi. I'm still on PHP5.4 (please don't either (a) laugh, (b) cry). Wanting to use DateTimeImmutable. No problem with polyfilling DateTimeInterface and DateTimeImmutable. Issue is currently DateTime does not implement DateTimeInterface. Once you've all mopped the tears from your eyes, I'm guessing there's no way to "coerce" DateTime to allow it to pass typehints of DateTimeInterface? Regards, Richard Quadling.

« previous php.general (#325454) next »