Doc #81218 [Opn->Csd]: get_object_vars returns parent class parameters

From: Date: Thu, 01 Jul 2021 17:10:07 +0000
Subject: Doc #81218 [Opn->Csd]: get_object_vars returns parent class parameters
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-18915@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=81218&edit=1 ID: 81218 Updated by: git@php.net Reported by: mixlion09 at gmail dot com Summary: get_object_vars returns parent class parameters -Status: Open +Status: Closed Type: Documentation Problem Package: Documentation problem Operating System: * PHP Version: 8.0.8 Block user comment: N Private report: N New Comment: Automatic comment on behalf of cmb69 Revision: https://github.com/php/doc-en/commit/c9bc21cb7302db778f3c519cbe6a9c8286dc08b8 Log: Fix #81218: get_object_vars returns parent class parameters Previous Comments: ------------------------------------------------------------------------ [2021-07-01 15:49:07] mixlion09 at gmail dot com Description: ------------ Documentation of get_object_vars says "Note that it will only return parameters defined on that object's class, not on its parent class" (from the https://www.php.net/manual/en/function.get-object-vars.php), but it returns parameters of the parent classes as well. Test script: --------------- class A { public $aProperty; } class B extends A { public $bProperty; } $b = new B(); var_dump(get_object_vars($b)); Expected result: ---------------- No misleading statement in the documentation ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=81218&edit=1

« previous php.doc.bugs (#18915) next »