|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #71098 "return" can't be used after "or"
Submitted: 2015-12-11 22:20 UTC Modified: 2016-06-23 23:37 UTC
From: admin at mvpro dot net Assigned: cmb (profile)
Status: Duplicate Package: Scripting Engine problem
PHP Version: Irrelevant OS: Any
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: admin at mvpro dot net
New email:
PHP Version: OS:


 [2015-12-11 22:20 UTC] admin at mvpro dot net
"return" can't be used after "or". I think it's strange because "die" for example can be used after "or".

Test script:

function connect()
	mysql_connect('localhost', '', '') or return false;
	return 1;

$connect = connect();
if( $connect == 1)
	echo 'Successfully connected';
	echo 'Connect failed!';

Expected result:
Connect failed!

Actual result:
Parse error: syntax error, unexpected 'return' (T_RETURN) on line 5


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2016-06-23 23:37 UTC]
-Status: Open +Status: Duplicate -Package: *General Issues +Package: Scripting Engine problem -Assigned To: +Assigned To: cmb
 [2016-06-23 23:37 UTC]
Duplicate of request #31627.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Jul 25 16:01:28 2024 UTC