php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #169 if/then/else
Submitted: 1998-03-14 00:30 UTC Modified: 1998-03-14 01:42 UTC
From: jon at clearink dot com Assigned:
Status: Closed Package: Parser error
PHP Version: 3.0 Latest CVS OS: solaris 2.5.1
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
18 + 28 = ?
Subscribe to this entry?

 
 [1998-03-14 00:30 UTC] jon at clearink dot com
this works:
$sM->getAction() == "" ? $sM->setAction ( $mainmenu ) : $foo = $bar;

this doesn't:
$sM->getAction() == "" ? $sM->setAction ( $mainmenu );


foo/bar don't even exist

i don't need an else in this case

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1998-03-14 01:42 UTC] zeev
The ? is a trinary operator, whether you need an else-part
or not.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 23 08:01:30 2024 UTC