[doc-en] master: Fix error in deconstructor example 5 (#4714)

From: Date: Tue, 03 Jun 2025 08:44:09 +0000
Subject: [doc-en] master: Fix error in deconstructor example 5 (#4714)
Groups: php.doc.cvs 
Request: Send a blank email to [email protected] to get a copy of this message
Author: Pierre Ambroise (Fan2Shrek)
Committer: GitHub (web-flow)
Pusher: sy-records
Date: 2025-06-03T16:32:26+08:00

Commit: https://github.com/php/doc-en/commit/82fc6a1c8670b96f1bd2b40932b6eb19929f4f6f
Raw diff: https://github.com/php/doc-en/commit/82fc6a1c8670b96f1bd2b40932b6eb19929f4f6f.diff

Fix error in deconstructor example 5 (#4714)

Changed paths:
  M  language/oop5/decon.xml


Diff:

diff --git a/language/oop5/decon.xml b/language/oop5/decon.xml
index 931a792184f1..dd17425e800c 100644
--- a/language/oop5/decon.xml
+++ b/language/oop5/decon.xml
@@ -262,7 +262,7 @@ class Product {
     public static function fromXml(string $xml): static {
         $data = simplexml_load_string($xml);
         $new = new static();
-        $new->id = $data->id;
+        $new->id = (int) $data->id;
         $new->name = $data->name;
         return $new;
     }


Thread (1 message)

  • Pierre Ambroise via GitHub
« previous php.doc.cvs (#22682) next »