php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #69653 'require' with if statement
Submitted: 2015-05-18 11:42 UTC Modified: 2015-05-18 11:47 UTC
From: abolfazl dot ziaratban at gmail dot com Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 5.6.9 OS: windows 8 32 bit
Private report: No CVE-ID: None
 [2015-05-18 11:42 UTC] 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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-05-18 11:47 UTC] abolfazl dot ziaratban at gmail dot com
-Status: Open +Status: Closed
 [2015-05-18 11:47 UTC] abolfazl dot ziaratban at gmail dot com
http://php.net/manual/en/function.include.php

Example #4 Comparing return value of include
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 23 06:01:30 2024 UTC