|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2016-06-23 23:37 UTC] cmb@php.net
-Status: Open
+Status: Duplicate
-Package: *General Issues
+Package: Scripting Engine problem
-Assigned To:
+Assigned To: cmb
[2016-06-23 23:37 UTC] cmb@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Dec 04 08:00:01 2025 UTC |
Description: ------------ "return" can't be used after "or". I think it's strange because "die" for example can be used after "or". Test script: --------------- <?php function connect() { mysql_connect('localhost', '', '') or return false; return 1; } $connect = connect(); if( $connect == 1) echo 'Successfully connected'; else echo 'Connect failed!'; Expected result: ---------------- Connect failed! Actual result: -------------- Parse error: syntax error, unexpected 'return' (T_RETURN) on line 5 https://3v4l.org/3qAYN