#43552 [Opn->Fbk]: Cannot find variables defined in files included

From: Date: Tue, 11 Dec 2007 10:57:22 +0000
Subject: #43552 [Opn->Fbk]: Cannot find variables defined in files included
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-120559@lists.php.net to get a copy of this message
ID: 43552 Updated by: jani@php.net Reported By: tariq at prime-service dot com -Status: Open +Status: Feedback -Bug Type: *Compile Issues +Bug Type: *General Issues Operating System: Windows Server 2003 PHP Version: 5.2.5 New Comment: Is short_open_tag php.ini directive on or off? (note: I can't reproduce this) Previous Comments: ------------------------------------------------------------------------ [2007-12-10 11:44:39] 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 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=43552&edit=1

« previous php.bugs (#120559) next »