Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Property hook variable missing when using get_object_vars #17988

Closed
Assignees
iluuu1994
@iquito

Description

@iquito

Description

The following code: (seehttps://3v4l.org/jnJJe#v8.4.4)

<?phpfinalclass SomeAction{publicfunction__construct(public ?string$powerOfAttorneyDate =null {            set =>$value ==='' ?null :$value;        },    ) {    }}$data =newSomeAction('2025-01-01');echo"powerOfAttorneyDate is included when printing the obj:\n";echoprint_r($data,true);echo"powerOfAttorneyDate is missing (bug) when using get_object_vars:\n";echoprint_r(get_object_vars($data),true);echo"powerOfAttorneyDate is included when using foreach on the object:\n";foreach ($dataas$name =>$value) {echo$name .' =>' .$value;}

Resulted in this output:

powerOfAttorneyDate is included when printing the obj:SomeAction Object(    [powerOfAttorneyDate] => 2025-01-01)powerOfAttorneyDate is missing (bug) when using get_object_vars:Array()powerOfAttorneyDate is included when using foreach on the object:powerOfAttorneyDate => 2025-01-01

But I expected this output instead:

powerOfAttorneyDate is included when printing the obj:SomeAction Object(    [powerOfAttorneyDate] => 2025-01-01)powerOfAttorneyDate is missing (bug) when using get_object_vars:Array(    [powerOfAttorneyDate] => 2025-01-01)powerOfAttorneyDate is included when using foreach on the object:powerOfAttorneyDate => 2025-01-01

PHP Version

PHP 8.4.4

Operating System

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp