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
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: 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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Wed Feb 05 14:01:32 2025 UTC