Bug #69653 [NEW]: 'require' with if statement

From: Date: Mon, 18 May 2015 11:42:21 +0000
Subject: Bug #69653 [NEW]: 'require' with if statement
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-192727@lists.php.net to get a copy of this message
From: abolfazl dot ziaratban at gmail dot com Operating system: windows 8 32 bit PHP version: 5.6.9 Package: Scripting Engine problem Bug Type: Bug Bug description:'require' with if statement 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 bug report at https://bugs.php.net/bug.php?id=69653&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=69653&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=69653&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=69653&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=69653&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=69653&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=69653&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=69653&r=needscript Try newer version: https://bugs.php.net/fix.php?id=69653&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=69653&r=support Expected behavior: https://bugs.php.net/fix.php?id=69653&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=69653&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=69653&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=69653&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=69653&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=69653&r=dst IIS Stability: https://bugs.php.net/fix.php?id=69653&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=69653&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=69653&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=69653&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=69653&r=mysqlcfg

« previous php.bugs (#192727) next »