Bug #69653 [Opn->Csd]: 'require' with if statement

From: Date: Mon, 18 May 2015 11:47:08 +0000
Subject: Bug #69653 [Opn->Csd]: 'require' with if statement
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-192728@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=69653&edit=1 ID: 69653 User updated by: abolfazl dot ziaratban at gmail dot com Reported by: abolfazl dot ziaratban at gmail dot com Summary: 'require' with if statement -Status: Open +Status: Closed Type: Bug Package: Scripting Engine problem Operating System: windows 8 32 bit PHP Version: 5.6.9 Block user comment: N Private report: N New Comment: http://php.net/manual/en/function.include.php Example #4 Comparing return value of include Previous Comments: ------------------------------------------------------------------------ [2015-05-18 11:42:21] abolfazl dot ziaratban at gmail dot com Description: ------------ --- From manual page: http://www.php.net/function.require --- PHP VERSION : 5.6.3 'require' with 'if' statement Test script: --------------- function a(){ #if((require 'test2.php') == 1) does it work if(require('test2.php') == 1); return true; } var_dump(a()); Expected result: ---------------- bool(true) Actual result: -------------- Warning: require(): Filename cannot be empty in test.php on line 3 Fatal error: require(): Failed opening required '' (include_path='.;php\PEAR') in test.php on line 3 ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=69653&edit=1

« previous php.bugs (#192728) next »