|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2019-12-03 13:36 UTC] public at grik dot net
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) {
}
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 21:00:01 2025 UTC |
with xdebug disabled it works fine PS C:\> php -r 'var_dump(new class{public string $x;});' object(class@anonymous)#1 (0) { ["x"]=> uninitialized(string) } enable xdebug 2.8.1 PS C:\> php -r 'var_dump(new class{public string $x;});' -d "zend_extension=xdebug" Command line code:1: class class@anonymous#1 (1) { } thanks and sorry for confusion