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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: abolfazl dot ziaratban at gmail dot com
New email:
PHP Version: OS:

 

 [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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 03 17:01:33 2025 UTC