#46428 [Bgs]: Can't make string comparison if the string ends with '=='

From: Date: Thu, 30 Oct 2008 11:32:06 +0000
Subject: #46428 [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-130317@lists.php.net to get a copy of this message
ID: 46428 User updated by: jaume dot bosch at atrapalo dot com Reported By: jaume dot bosch at atrapalo dot com Status: Bogus Bug Type: Scripting Engine problem Operating System: FreeBSD PHP Version: 5.2.6 New Comment: ok, sorry it's only a copy-paste bug on myself Thx a lot Previous Comments: ------------------------------------------------------------------------ [2008-10-30 11:09:52] felipe@php.net See: $foo=substr($foo(0 <--------- ,strlen($foo)-2)); ------------------------------------------------------------------------ [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

« previous php.bugs (#130317) next »