#46263 [Opn->Fbk]: Incorrect type hinting stops page execution without error
| From: | jani@php.net | Date: | Thu, 09 Oct 2008 12:22:56 +0000 |
| Subject: | #46263 [Opn->Fbk]: Incorrect type hinting stops page execution without error | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-129587@lists.php.net to get a copy of this message | ||
ID: 46263
Updated by: jani@php.net
Reported By: pankkake at headfucking dot net
-Status: Open
+Status: Feedback
Bug Type: Reproducible crash
Operating System: Linux
PHP Version: 5.2.6
New Comment:
$ php -r 'public static function getWatchedColumns(string $class)'
PHP Parse error: syntax error, unexpected T_PUBLIC in Command line
code on line 1
Perhaps you should give a better example OR simply tune your error
reporting (display_errors = On and error_reporting = E_ALL)..
Previous Comments:
------------------------------------------------------------------------
[2008-10-09 08:02:52] pankkake at headfucking dot net
Description:
------------
When using type hinting on a function with a type that isn't allowed
(int, string, etc.), PHP stops the execution of the page (it doesn't
seem to crash) without any error, making debugging very hard.
Reproduce code:
---------------
public static function getWatchedColumns(string $class)
(I *know* the code is wrong, that's the point.)
Expected result:
----------------
a PHP error
Actual result:
--------------
blank page
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=46263&edit=1