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
 [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

Pull Requests

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: Sat Dec 21 11:01:30 2024 UTC