php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #54933 Notice: Undefined variable: dbname
Submitted: 2011-05-26 08:57 UTC Modified: 2011-05-26 14:41 UTC
From: future_evolium at yahoo dot com Assigned:
Status: Not a bug Package: Program Execution
PHP Version: 5.3SVN-2011-05-26 (SVN) OS: WindowsXP
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: future_evolium at yahoo dot com
New email:
PHP Version: OS:

 

 [2011-05-26 08:57 UTC] future_evolium at yahoo dot com
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


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-05-26 14:41 UTC] rasmus@php.net
-Status: Open +Status: Bogus
 [2011-05-26 14:41 UTC] rasmus@php.net
Your example works fine exactly as written.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 02:01:29 2024 UTC