|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2005-01-20 19:28 UTC] mnemo at minimum dot se
Description: ------------ I wish "return doh" was treated like an expression when though this expression will never be computable. The reason is that I want to write this: mysql_connect(blah) or return false; Just like I do with die etc. PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 12:00:01 2025 UTC |
binarycleric - that doesn't do the same thing in the slightest. That would cause the return to run either way. What mnemo wants is for the return to happen ONLY if mysql fails. Otherwise it should continue to the next line. This works: function foo() {} mysql_connect(blah) or foo(false); But this doesn't: mysql_connect(blah) or return(false); And I think it should.