|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2011-05-19 18:00 UTC] rasmus@php.net
-Status: Open
+Status: Bogus
-Block user comment: No
+Block user comment: Yes
[2011-05-19 18:00 UTC] rasmus@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 08:00:02 2025 UTC |
Description: ------------ Since the dawn of time the PHP documentation has contained function declarations like this: string strstr ( string $haystack , mixed $needle [, bool $before_needle = false ] ) But the PHP parser does not allow this syntax. Many people have been trying to get proper type hinting into PHP for some time now, and I appreciate some of the problems in doing so (although it really is needed ASAP). However, as far as I'm concerned, a good 60% of the reason for wanting type hinting is for documentation purposes, and readability. Until the type hinting is implemented fully, please can we at least allow the PHP parser to accept the type hinting keywords for documentation purposes. At the moment I'm on the verge of writing an extended PHP language with type hinting that compiles to PHP by removing the type keywords. That's completely insane, but the current situation leaves no choice. Thanks. Test script: --------------- function int foo(bool bar, string baz) { } Expected result: ---------------- The PHP parser should at least accept this syntax, even if it's not used yet. Actual result: -------------- Parse error.