|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-08-03 16:53 UTC] sniper@php.net
[2005-08-03 23:25 UTC] missingno at ifrance dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Dec 14 08:00:01 2025 UTC |
Description: ------------ I think the require language construct may be broken in PHP 5.0.4 under Windows/Apache2 as it seems to ignore return statements in conditionnal blocks. Note: if you set $myvar to 0 in the code, there's no such problem. Reproduce code: --------------- <? // testfile.php $myvar = 1; include('maininc.php'); myfunc(); ?> <? // maininc.php if ($myvar == 1) { require('sndinc.php'); return; } function myfunc() { echo "Exec'ed from maininc.php!!"; } ?> <? // sndinc.php function myfunc() { echo "Second included file..."; } ?> Expected result: ---------------- I would expect the script to simply echo "Second included file..." and terminate. Actual result: -------------- Fatal error: Cannot redeclare myfunc() (previously declared in D:\HTTPd\www\tests\maininc.php:8) in D:\HTTPd\www\tests\sndinc.php on line 5