PHP 4.0 Bug #8366 Updated: the results returned for isset() do not seem to match those returned in php3.

From: Date: Fri, 22 Dec 2000 10:04:26 +0000
Subject: PHP 4.0 Bug #8366 Updated: the results returned for isset() do not seem to match those returned in php3.
Groups: php.dev 
Request: Send a blank email to php-dev+get-42111@lists.php.net to get a copy of this message
ID: 8366 Updated by: hholzgra Reported By: beth@iensemble.com Old-Status: Open Status: Closed Bug Type: *Function Specific Assigned To: Comments: php 4 has a true boolean type while php 3 hadn't so isset() returned an integer in php 3 (same behavior as your if-statement) php 4 isset() returns 'true' or 'false' instead, converting theese boolean values into strings will give a '1' for 'true' and '' (the empty string) for false Previous Comments: --------------------------------------------------------------------------- [2000-12-21 16:04:22] beth@iensemble.com <?php echo "can edit: ".$c_edit; if (isset($c_edit)){ $edit=1; } else { $edit = 0; } $edit2 = isset($c_edit); echo "<br>edit: ".$edit; echo "<br>edit2: ".$edit2; ?> for php3.0.14 (http://stage.iensemble.com/beth/isset_test.php) , the above code returns thee same results for the variables $edit and $edit2. In php 4.0.1pl2 (http://www.ddeb3.org/php/isset_test.php), however, no value is returned for $edit2. This seems to happen whether on WinNT, Apache or Linux systems. --------------------------------------------------------------------------- Full Bug description available at: http://bugs.php.net/?id=8366

« previous php.dev (#42111) next »