Edit report at http://bugs.php.net/bug.php?id=52422&edit=1
ID: 52422 Updated by: [email protected] Reported by: g dot kuizinas at gmail dot com Summary: Strange behavior of the function. Status: Bogus Type: Bug Package: *General Issues Operating System: UNIX (CENTOS) PHP Version: 5.3.3 New Comment: Yes, It's expected and how PHP handle the types since the begin. Previous Comments: ------------------------------------------------------------------------ [2010-07-24 00:20:50] g dot kuizinas at gmail dot com I do realize this. However, should this be an expected behavior? I mean, it is quite tricky and many people may get lost. ------------------------------------------------------------------------ [2010-07-24 00:17:53] [email protected] Hi, this is because 'newsletter' is converted to integer zero. See http://docs.php.net/manual/en/types.comparisons.php ------------------------------------------------------------------------ [2010-07-23 23:32:51] g dot kuizinas at gmail dot com Description: ------------ There is nothing much to describe actually. I call a function with: die( hp_mail_wrapper('Subject', 'body') ); And my function looks like this: function hp_mail_wrapper($title, $body, $theme = 0, $vars = array()) { if($theme == 'newsletter') { die('What???'); } die('Good'); } Strangely enough script dies with 'What???'. If I change $theme = 0 to anything else, like NULL, FALSE (anything), it works fine. I also dumped the incoming args to avoid reporting a sleepy-bug, but as expected, the only variables that function get is $title and $body. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/bug.php?id=52422&edit=1
