|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2017-04-19 21:28 UTC] cmb@php.net
-Status: Open
+Status: Not a bug
-Package: PHP Language Specification
+Package: Scripting Engine problem
-Assigned To:
+Assigned To: cmb
[2017-04-19 21:28 UTC] cmb@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Dec 16 19:00:01 2025 UTC |
Description: ------------ Cast and TypeHint do not have the expected behavior (function () : object { return (object) []; })(); must be an instance of object, instance of stdClass returned Test script: --------------- php -a php > (function () : object { return (object) []; })(); PHP Warning: Uncaught TypeError: Return value of {closure}() must be an instance of object, instance of stdClass returned in php shell code:1 Stack trace: #0 php shell code(1): {closure}() #1 {main} thrown in php shell code on line 1 Expected result: ---------------- Work normal Actual result: -------------- PHP Warning: Uncaught TypeError: Return value of {closure}() must be an instance of object, instance of stdClass returned in php shell code:1 Stack trace: #0 php shell code(1): {closure}() #1 {main} thrown in php shell code on line 1