#46428 [Opn->Bgs]: Can't make string comparison if the string ends with '=='
| From: | felipe@php.net | Date: | Thu, 30 Oct 2008 11:09:53 +0000 |
| Subject: | #46428 [Opn->Bgs]: Can't make string comparison if the string ends with '==' | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-130315@lists.php.net to get a copy of this message | ||
ID: 46428
Updated by: felipe@php.net
Reported By: jaume dot bosch at atrapalo dot com
-Status: Open
+Status: Bogus
Bug Type: Scripting Engine problem
Operating System: FreeBSD
PHP Version: 5.2.6
New Comment:
See: $foo=substr($foo(0 <--------- ,strlen($foo)-2));
Previous Comments:
------------------------------------------------------------------------
[2008-10-30 11:08:17] jaume dot bosch at atrapalo dot com
Description:
------------
In the code below, you can see a string called 'foo', if you try to
make a strstr, strpos, ereg, ..., to this string you get this error:
It seems that a string ending with '==' it's understand as a function
call.
Reproduce code:
---------------
<?php
$foo='asdfdgfsg==';
if (strstr($foo,'==')) $foo=substr($foo(0,strlen($foo)-2));
echo $foo;
?>
Expected result:
----------------
asdfdgfsg
Actual result:
--------------
PHP Fatal error: Call to undefined function asdfdgfsg==() in
/usr/home/myuser/test.php on line 3
PHP Stack trace:
PHP 1. {main}() /usr/home/myuser/test.php:0
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=46428&edit=1