[doc-en] master: Amend array ↔ object casting example (#6139)
| From: | Mikhail Alferov via GitHub | Date: | Tue, 24 Nov 2026 15:06:33 +0000 |
| Subject: | [doc-en] master: Amend array ↔ object casting example (#6139) | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-24008@lists.php.net to get a copy of this message | ||
Author: Mikhail Alferov (mmalferov)
Committer: GitHub (web-flow)
Pusher: lacatoire
Date: 2026-11-24T16:06:29+01:00
Commit: https://github.com/php/doc-en/commit/86489832fab924a8c07fedf337ecd46ec85be83e
Raw diff: https://github.com/php/doc-en/commit/86489832fab924a8c07fedf337ecd46ec85be83e.diff
Amend array ↔ object casting example (#6139)
* Update incompatible.xml
* Update incompatible.xml
Changed paths:
M appendices/migration72/incompatible.xml
Diff:
diff --git a/appendices/migration72/incompatible.xml b/appendices/migration72/incompatible.xml
index d936d832155f..996d17c8873d 100644
--- a/appendices/migration72/incompatible.xml
+++ b/appendices/migration72/incompatible.xml
@@ -58,7 +58,7 @@ var_dump(
<screen>
<![CDATA[
object(stdClass)#1 (1) {
- ["0"]=> // string key now, rather than integer key
+ ["0"]=> // string property name now, rather than integer one
int(1)
}
int(1)
@@ -81,7 +81,8 @@ int(1)
$obj = new class {
public function __construct()
{
- $this->{0} = 1;
+ $this->{0} = 1; // Properties are stored under string names,
+ // even when initialized with an int name
}
};
$arr = (array) $obj;