3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php try { new DatePeriod(new DateTime('yesterday'), new DateInterval('P1D'), 'foo'); } catch (Exception $exception) { echo $exception->getMessage(), "\n"; } try { new DatePeriod(new DateTime('yesterday'), new DateInterval('P1D'), 'bar'); } catch (Exception $exception) { echo $exception->getMessage(), "\n"; }
based on 2jGLG
Output for 7.1.25 - 7.3.4
DatePeriod::__construct(): This constructor accepts either (DateTimeInterface, DateInterval, int) OR (DateTimeInterface, DateInterval, DateTime) OR (string) as arguments. DatePeriod::__construct(): This constructor accepts either (DateTimeInterface, DateInterval, int) OR (DateTimeInterface, DateInterval, DateTime) OR (string) as arguments.