#20931 [Com]: is_null ceases to function
| From: | gregaryh at juno dot com | Date: | Wed, 11 Dec 2002 07:13:13 +0000 |
| Subject: | #20931 [Com]: is_null ceases to function | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-27320@lists.php.net to get a copy of this message | ||
ID: 20931
Comment by: gregaryh@juno.com
Reported By: gregaryh@juno.com
Status: Bogus
Bug Type: Variables related
Operating System: debian linux
PHP Version: 4.2.3
New Comment:
why would this exact code work in php ver. 4.2.1 but not in ver 4.2.3
if it is not a bug?
Previous Comments:
------------------------------------------------------------------------
[2002-12-11 01:10:33] sniper@php.net
Sorry, but your problem does not imply a bug in PHP itself. For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system
is not the
appropriate forum for asking support questions.
Thank you for your interest in PHP.
$_POST['somevar'] is definately not NULL..
------------------------------------------------------------------------
[2002-12-11 01:07:07] gregaryh@juno.com
I recently compiled php 4.2.3 on my debian system under apache 2.0. I
then uploaded a site that was developed on another machine running
apache 1.3 and php 4.2.1. While testing the site i noticed something
seemed wrong. Upon further investigation i found that the is_null
function, which was working perfectly on the other system, seemed to be
malfunctioning.
for example:
if (is_null($somevar)){
execute code A
}
code A would execute regardless of whether $somevar had a null value or
not
if i do the following:
echo is_null($somevar)
nothing was echoed to the screen, again regardless of the value of
$somevar
if i did the following however with $somevar set to null:
if($somevar == null){
execute code A
if(is_null($somevar)){
execute code b
}
}
code A will execute but code B will not.
the value of somevar is assigned by an html form sent using the POST
method as this example illustrates:
$somevar = $_POST['$formvar'];
the purpose of the code is to check if a field was left blank.
This code worked fine on the original server but failed to work when
copied to the new server
my configuration is as follows:
./configure' '--prefix=/usr/local/apache2/php'
'--with-apxs2=/usr/local/apache2/bin/apxs'
'--with-config-file-path=/etc' '--with-mysql'
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=20931&edit=1