php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #8366 the results returned for isset() do not seem to match those returned in php3.
Submitted: 2000-12-21 16:04 UTC Modified: 2000-12-22 05:04 UTC
From: beth at iensemble dot com Assigned:
Status: Closed Package: *Function Specific
PHP Version: 4.0.1pl2 OS: same results in Linux; Apache an
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
37 - 20 = ?
Subscribe to this entry?

 
 [2000-12-21 16:04 UTC] beth at iensemble dot 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.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-12-22 05:04 UTC] hholzgra@php.net
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
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri May 17 07:01:32 2024 UTC