|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2015-05-04 19:45 UTC] requinix@php.net
-Status: Open
+Status: Wont fix
[2015-05-04 19:45 UTC] requinix@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 10:00:01 2025 UTC |
Description: ------------ I would have expected that I can use the same type hinting in the 'use' clause of a closure as in the parameter list. It's not a bug since it's not documented to be working but it's an issue in consistency. Test script: --------------- <?php $a = function() use ( stdClass $b) { return 'hi';}; echo $a(); Expected result: ---------------- hi Actual result: -------------- Parse error: syntax error, unexpected 'stdClass' (T_STRING), expecting '&' or variable (T_VARIABLE) in [...] on line 2