|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2014-07-29 18:57 UTC] requinix@php.net
-Status: Open
+Status: Not a bug
[2014-07-29 18:57 UTC] requinix@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 01 04:00:02 2025 UTC |
Description: ------------ PDOStatement::fetch with PDO::FETCH_CLASS works fine, until I tried to use it with parent class private properties... See the test script. Test script: --------------- class Animal { private $color; public function getColor() { return $this->color; } } class Cat extends Animal { } $statement->setFetchMode(PDO::FETCH_CLASS, "Cat" ); $someCat = $statement->fetch(); echo $someCat->getColor(); //empty print_r( $someCat ); /* now have strange output like: [color:Animal:private] => [color] => grey */ Expected result: ---------------- All private properties of parent class have to be set same way as public and protected ones. Actual result: -------------- Private property of parent class still empty :(