#41139 [Opn->Bgs]: include() & eval() scope

From: Date: Thu, 19 Apr 2007 19:36:58 +0000
Subject: #41139 [Opn->Bgs]: include() & eval() scope
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-111696@lists.php.net to get a copy of this message
ID: 41139 Updated by: tony2001@php.net Reported By: tim dot brown at bedspace dot co dot uk -Status: Open +Status: Bogus Bug Type: Scripting Engine problem Operating System: Win XP PHP Version: 5.2.1 New Comment: Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php This is expected behaviour. Previous Comments: ------------------------------------------------------------------------ [2007-04-19 17:12:01] tim dot brown at bedspace dot co dot uk Description: ------------ When you use an include() or eval() within a function, return() does not end execution of the function. Also __FUNCTION__ does not work within an include() or eval() within a function. Reproduce code: --------------- <?php function test(){ eval("echo __FUNCTION__;"); eval("return 123;"); return "abc"; } $x = test(); var_dump($x); ?> Expected result: ---------------- I would expect to see: test int(123) Actual result: -------------- output: string(3) "abc" ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=41139&edit=1

« previous php.bugs (#111696) next »