Doc #80019 [NEW]: get_object_vars() does not return uninitialized properties
| From: | brego at hey dot com | Date: | Wed, 26 Aug 2020 10:22:16 +0000 |
| Subject: | Doc #80019 [NEW]: get_object_vars() does not return uninitialized properties | ||
| Groups: | php.doc.bugs | ||
| Request: | Send a blank email to doc-bugs+get-17814@lists.php.net to get a copy of this message | ||
From: brego at hey dot com
Operating system: macOS 10.15.6
PHP version: 7.4.9
Package: Documentation problem
Bug Type: Documentation Problem
Bug description:get_object_vars() does not return uninitialized properties
Description:
------------
---
From manual page: https://php.net/function.get-object-vars
---
I realize the code works as intended#1 however the documentation of
get_object_vars does not mention that uninitialized object properties
will not be returned.
#1: https://bugs.php.net/bug.php?id=79236
Test script:
---------------
class A {
public function get() {
var_dump(get_object_vars($this));
}
}
class B extends A {
public $foo;
public $bar = 'bar';
public string $baz;
}
$b = new B;
$b->get();
Expected result:
----------------
array(3) {
["foo"]=>
NULL
["bar"]=>
string(3) "bar"
["baz"]=>
uninitialized // <- or something different?
}
Actual result:
--------------
array(2) {
["foo"]=>
NULL
["bar"]=>
string(3) "bar"
}
--
Edit bug report at https://bugs.php.net/bug.php?id=80019&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=80019&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=80019&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=80019&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=80019&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=80019&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=80019&r=support
Expected behavior: https://bugs.php.net/fix.php?id=80019&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=80019&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=80019&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=80019&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=80019&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=80019&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=80019&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=80019&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=80019&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=80019&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=80019&r=mysqlcfg