Bug #78901 [NEW]: wrong output of var_dump() for uninitialized named properties
| From: | public at grik dot net | Date: | Tue, 03 Dec 2019 13:36:38 +0000 |
| Subject: | Bug #78901 [NEW]: wrong output of var_dump() for uninitialized named properties | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-224022@lists.php.net to get a copy of this message | ||
From: public at grik dot net
Operating system:
PHP version: 7.4.0
Package: *General Issues
Bug Type: Bug
Bug description:wrong output of var_dump() for uninitialized named properties
Description:
------------
var_dump() does not show named properties that were not initialized,
it just shows that _something_ is there
Test script:
---------------
<?php
class A{
public string $x;
}
var_dump(property_exists($A,'x'));//true
var_dump($A); //class A#1 (1) {} // - it counts the property, but hides
it
var_dump(new stdClass()); //class stdClass#1 (0) {} - empty object
Expected result:
----------------
class A#1 (1) {
public $x =>
NULL
}
Actual result:
--------------
class A#1 (1) {
}
--
Edit bug report at https://bugs.php.net/bug.php?id=78901&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=78901&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=78901&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=78901&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=78901&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=78901&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=78901&r=support
Expected behavior: https://bugs.php.net/fix.php?id=78901&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=78901&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=78901&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=78901&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=78901&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=78901&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=78901&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=78901&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=78901&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=78901&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=78901&r=mysqlcfg