library datetimeinterface-shim
A shim for using PHP >=5.5's DateTimeInterface in a PHP >=5.3 application
jeskew/datetimeinterface-shim
A shim for using PHP >=5.5's DateTimeInterface in a PHP >=5.3 application
- Sunday, November 15, 2015
- by jeskew
- Repository
- 2 Watchers
- 0 Stars
- 9 Installations
- PHP
- 0 Dependents
- 0 Suggesters
- 0 Forks
- 0 Open issues
- 2 Versions
- 0 % Grown
, (*1)
Stuck on PHP 5.3 or 5.4 but want to typehint against \DateTimeInterface?
Install this package and use the included DateTime class:, (*2)
<?php
use DateTimeCompat\DateTime;
$now = new DateTime();
$fromFormat = DateTime::fromFormat('U', (string) time());
Already have an instance of \DateTime? This package uses nesbot/carbon under the hood, so all of its
convenience methods are available to you, including instance:, (*3)
DateTime::instance(new \DateTime) instanceof 'DateTimeInterface' === true
dev-master
9999999-dev
A shim for using PHP >=5.5's DateTimeInterface in a PHP >=5.3 application
Sources
Download
MIT
The Requires
The Development Requires
by
Jonathan Eskew
0.1.0
0.1.0.0
A shim for using PHP >=5.5's DateTimeInterface in a PHP >=5.3 application
Sources
Download
MIT
The Requires
The Development Requires
by
Jonathan Eskew