Skip to content

ext/date: applied fixers to improve test robustness - #23039

Merged
derickr merged 1 commit into
php:masterfrom
NickSdot:test/hardening/ext-date
Aug 18, 2026
Merged

ext/date: applied fixers to improve test robustness#23039
derickr merged 1 commit into
php:masterfrom
NickSdot:test/hardening/ext-date

Conversation

@NickSdot

@NickSdot NickSdot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Asserts error class; extracted from: #22799

try {
new DatePeriod($date, new DateInterval('P1D'), 2);
} catch (Error $e) {
echo get_class($e), ': ', $e->getMessage(), "\n";

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This (and following) safe us a function call; not style-only.

c(Asia/Tokyo): 2015-4-1 <--> 2015-4-29
int(0)
int(28)

@NickSdot NickSdot Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This (and following) removes double empty last line.

var_dump( timezone_offset_get($tz, $invalid_obj) );
} catch (Error $ex) {
var_dump($ex->getMessage());
echo "\n";

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bloat.

@NickSdot
NickSdot marked this pull request as ready for review August 4, 2026 15:20
@NickSdot
NickSdot requested a review from derickr as a code owner August 4, 2026 15:20
@derickr
derickr merged commit 170ca63 into php:master Aug 18, 2026
18 checks passed
@NickSdot
NickSdot deleted the test/hardening/ext-date branch August 18, 2026 17:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

2 participants