#42639 [Opn->Fbk]: include in if-expression problem

From: Date: Wed, 12 Sep 2007 11:07:04 +0000
Subject: #42639 [Opn->Fbk]: include in if-expression problem
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-117437@lists.php.net to get a copy of this message
ID: 42639 Updated by: jani@php.net Reported By: koraktor at web dot de -Status: Open +Status: Feedback Bug Type: Scripting Engine problem Operating System: Windows XP SP2 PHP Version: 5.2.4 New Comment: You do realize that include is a language construct and not a regular function? Please provide short but _complete_ example script which shows the problem clearly. Previous Comments: ------------------------------------------------------------------------ [2007-09-12 08:44:02] koraktor at web dot de Description: ------------ Included code in an if-expression is only available in the if-branch not the if-expression itself. Reproduce code: --------------- if(file_exists("code_to_include.php") && include("code_to_include.php") && check_included_code()) { task(); } Expected result: ---------------- Included code from "code_to_include.php" should be accessible in check_included_code() and anything afterwards. Actual result: -------------- Included code from "code_to_include.php" is accessible in task(), but not in check_included_code(). ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=42639&edit=1

« previous php.bugs (#117437) next »