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
 [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: Thu Apr 18 00:01:28 2024 UTC