DateInterval::$from_string undefined until a lookup
オープン
@derickr がすでに取り組んでいます。
2024年6月21日 から。
Bug
Extension: date
Status: Needs Triage
- 主要言語
- C
- スター
- 40.4k
- フォーク
- 8.2k
- 平均マージ
- 2日 13時間
- マージ済み PR(30日)
- 96
説明
Description
The following code:
<?php
$dateInterval = new DateInterval('PT1S'); // or even DateInterval::createFromDateString('1 second')
var_dump(isset($dateInterval->from_string));
(array) $dateInterval; // or print_r() or var_dump()
var_dump(isset($dateInterval->from_string));
Resulted in this output:
bool(false)
bool(true)
But I expected this output instead:
bool(true)
bool(true)
According documentation property $from_string should be always defined (in PHP >= 8.2) but it isn't. Dump of the object initializes the property "ad hoc". var_dump() shouldn't have side effects IMHO.
PHP Version
PHP 8.2.20
Operating System
No response
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
評価
この issue はまだ評価されていません。