Bug #54933 [NEW]: Notice: Undefined variable: dbname

From: Date: Thu, 26 May 2011 06:57:18 +0000
Subject: Bug #54933 [NEW]: Notice: Undefined variable: dbname
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-160969@lists.php.net to get a copy of this message
From:             
Operating system: WindowsXP
PHP version:      5.3SVN-2011-05-26 (SVN)
Package:          Program Execution
Bug Type:         Bug
Bug description:Notice: Undefined variable: dbname

Description:
------------
I want to report a bug as soon as I installed the PHP version 5.3.5

   This bug concern the function include(). For example if I have a php
file which include another php file and if I'm trying to use the variable
declared in the included file for my parent file I have the error:
Notice: Undefined variable: dbname

Test script:
---------------
Here is my test with running parent.php
I have three files:
parent.php
<?php
include('declared.php');  
$message=$dbname." should work";
echo $message;
?>

declared.php
<?php
$dbname="this script";
?>

Expected result:
----------------
I expect to recognize my variable and to print out.

this script should work


-- 
Edit bug report at http://bugs.php.net/bug.php?id=54933&edit=1
-- 
Try a snapshot (PHP 5.2):            http://bugs.php.net/fix.php?id=54933&r=trysnapshot52
Try a snapshot (PHP 5.3):            http://bugs.php.net/fix.php?id=54933&r=trysnapshot53
Try a snapshot (trunk):              http://bugs.php.net/fix.php?id=54933&r=trysnapshottrunk
Fixed in SVN:                        http://bugs.php.net/fix.php?id=54933&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=54933&r=needdocs
Fixed in release:                    http://bugs.php.net/fix.php?id=54933&r=alreadyfixed
Need backtrace:                      http://bugs.php.net/fix.php?id=54933&r=needtrace
Need Reproduce Script:               http://bugs.php.net/fix.php?id=54933&r=needscript
Try newer version:                   http://bugs.php.net/fix.php?id=54933&r=oldversion
Not developer issue:                 http://bugs.php.net/fix.php?id=54933&r=support
Expected behavior:                   http://bugs.php.net/fix.php?id=54933&r=notwrong
Not enough info:                     http://bugs.php.net/fix.php?id=54933&r=notenoughinfo
Submitted twice:                     http://bugs.php.net/fix.php?id=54933&r=submittedtwice
register_globals:                    http://bugs.php.net/fix.php?id=54933&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=54933&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=54933&r=dst
IIS Stability:                       http://bugs.php.net/fix.php?id=54933&r=isapi
Install GNU Sed:                     http://bugs.php.net/fix.php?id=54933&r=gnused
Floating point limitations:          http://bugs.php.net/fix.php?id=54933&r=float
No Zend Extensions:                  http://bugs.php.net/fix.php?id=54933&r=nozend
MySQL Configuration Error:           http://bugs.php.net/fix.php?id=54933&r=mysqlcfg



Thread (2 messages)

« previous php.bugs (#160969) next »