php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #43552 Cannot find variables defined in files included
Submitted: 2007-12-10 11:44 UTC Modified: 2007-12-12 05:57 UTC
From: tariq at prime-service dot com Assigned:
Status: Closed Package: *General Issues
PHP Version: 5.2.5 OS: Windows Server 2003
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: tariq at prime-service dot com
New email:
PHP Version: OS:

 

 [2007-12-10 11:44 UTC] tariq at prime-service dot com
Description:
------------
variables defined in files included are not being populated. However if we print something in included file it displays on the screen. But variables and their values are not passed to the file calling the included file.

Reproduce code:
---------------
Test1.php
<?
$A = 10;
$B = 15;
?>

Test2.php
<?php
require('Test1.php');
echo $A;
?>
it would result into variable undefined warning.

Expected result:
----------------
10 in output

Actual result:
--------------
Warning! variable not defined

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-12-11 10:57 UTC] jani@php.net
Is short_open_tag php.ini directive on or off?
(note: I can't reproduce this)
 [2007-12-12 05:57 UTC] tariq at prime-service dot com
Sorry I bothered you for this little problem. short_open_tag  directive in  php.ini was off
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri May 17 04:01:34 2024 UTC