#20353 [Opn->Fbk]: Change of isset behaviour

From: Date: Mon, 11 Nov 2002 10:20:38 +0000
Subject: #20353 [Opn->Fbk]: Change of isset behaviour
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-24528@lists.php.net to get a copy of this message
ID: 20353 Updated by: derick@php.net Reported By: bariou@brasnah.com -Status: Open +Status: Feedback Bug Type: Strings related Operating System: Red hat 7.2 PHP Version: 4.3.0-pre2 New Comment: Please recompile and add the configure option --disable-mbstring. Does the problem still occur then? Derick Previous Comments: ------------------------------------------------------------------------ [2002-11-11 04:16:32] bariou@brasnah.com You are right,but there is a change. I was not specific enough, in fact I send a variable through the get method http://somewhere/test_isset.php?bibi=& The test_isset.php file is : <?php $namevar="bibi"; if(isset($$namevar)){ echo "it comes here even if the string is empty <BR>"; }else{ echo "it comes here NAMEVAR is not set or is empty <BR>"; } if(isset($name)){ echo "it comes here if set even if the string is empty <BR>"; }else{ echo "it comes here NAME is not set <BR>"; } ?> With the previous http request : For 4.3.0-pre2 bibi is never set For 4.2.2 bibi is not set only when I remove = from the get URL, it seems logic Idea ? Thanks ------------------------------------------------------------------------ [2002-11-11 03:46:53] derick@php.net I can't reproduce this, works fine for me: [derick@kossu derick]$ php <?php $foo = ""; if (isset($foo)) { echo "IN HERE!\n"; } ?> IN HERE! [derick@kossu derick]$ php -v PHP 4.3.0-pre2 (cli) Copyright (c) 1997-2002 The PHP Group Zend Engine v1.3.0, Copyright (c) 1998-2002 Zend Technologies with eXtended Debugger (xdebug) v1.1.0dev, Copyright (c) 2002 JDI Media Solutions, by Derick Rethans Please post a full reproducing script that we can copy & paste, but keep it as small as possible. Derick ------------------------------------------------------------------------ [2002-11-11 03:42:11] bariou@brasnah.com On 4.2.2 I've if(isset($namevar)){ //some statements // It comes here if $namevar is set, even if $namevar=""; } On 4.3.0-pre2 I've if(isset($namevar)){ //some statements // It doesn't come if $namevar=""; } You can't change that to much legacy.... ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=20353&edit=1

« previous php.bugs (#24528) next »