Download src/php/php-src/ext/date/tests/68062.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 445 Bytes
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/date/tests/68062.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/ext/date/tests/68062.phpt
-
curl -L -o 68062.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/date/tests/68062.phpt
445 Bytes
| --TEST-- | |
| DateTimeZone::getOffset() accepts a DateTimeInterface object | |
| --FILE-- | |
| $tz = new DateTimeZone('Europe/London'); | |
| $dt = new DateTimeImmutable('2014-09-20', $tz); | |
| echo $tz->getOffset($dt), "\n"; | |
| try { | |
| echo $tz->getOffset(1); | |
| } catch (TypeError $e) { | |
| echo $e::class, ': ', $e->getMessage(), "\n"; | |
| } | |
| --EXPECT-- | |
| 3600 | |
| TypeError: DateTimeZone::getOffset(): Argument #1 ($datetime) must be of type DateTimeInterface, int given | |