php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #2468 Inconsistent description of unset variables passed to functions
Submitted: 1999-10-08 15:24 UTC Modified: 2000-07-26 13:16 UTC
From: jaker at more dot com Assigned:
Status: Closed Package: Misbehaving function
PHP Version: 3.0.12 OS: Solaris 2.6
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: jaker at more dot com
New email:
PHP Version: OS:

 

 [1999-10-08 15:24 UTC] jaker at more dot com
Suppose there is a function which takes one argument.  If an unset variable is passed to the function it is reported as not being set, but it is reported as being a string.

For example:

function foo($var) {
  if(isset($var)) {
    echo "Argument is set.";
  }
  if(is_string($var)) {
    echo "Argument is a string.";
  }
}

foo($nonExistentVar);

This will output:

Argument is a string.

Thus, PHP considers $nonExistentVar to be both unset *and* a string at the same time.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-07-26 13:16 UTC] hholzgra@php.net
well, that's the way it is for php3
this has been improved in php4


 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Sat Oct 10 11:00:01 2026 UTC