#46263 [Csd->Bgs]: Incorrect type hinting stops page execution without error
| From: | felipe@php.net | Date: | Thu, 09 Oct 2008 13:03:39 +0000 |
| Subject: | #46263 [Csd->Bgs]: Incorrect type hinting stops page execution without error | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-129592@lists.php.net to get a copy of this message | ||
ID: 46263
Updated by: felipe@php.net
Reported By: pankkake at headfucking dot net
-Status: Closed
+Status: Bogus
Bug Type: Reproducible crash
Operating System: Linux
PHP Version: 5.2.6
Previous Comments:
------------------------------------------------------------------------
[2008-10-09 12:56:57] pankkake at headfucking dot net
The probles occurs when calling the function, not defining it.
However by calling
error_reporting(E_ALL);
before, I get :
PHP Catchable fatal error: Argument 1 passed to
sfPropelModerationBehavior::getWatchedColumns() must be an instance of
string, string given, called in test.php on line 10 and defined in
plugins/sfModerationPlugin/lib/sfPropelModerationBehavior.class.php on
line 438
I guess we have an issue in our Symfony configuration, the development
environment is supposed to be E_ALL|E_STRICT...
------------------------------------------------------------------------
[2008-10-09 12:22:56] jani@php.net
$ 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)..
------------------------------------------------------------------------
[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