xref: /php-src/ext/date/tests/bug54283.phpt (revision adc26424)
1--TEST--
2Bug #54283 (new DatePeriod(NULL) causes crash)
3--FILE--
4<?php
5
6try {
7    var_dump(new DatePeriod(NULL));
8} catch (Exception $e) {
9    var_dump($e->getMessage());
10}
11
12?>
13--EXPECTF--
14Deprecated: DatePeriod::__construct(): Passing null to parameter #1 ($start) of type string is deprecated in %s on line %d
15
16Deprecated: Calling DatePeriod::__construct(string $isostr, int $options = 0) is deprecated, use DatePeriod::createFromISO8601String() instead in %s on line %d
17string(24) "Unknown or bad format ()"
18