php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #12244 Short form of if-clause
Submitted: 2001-07-19 04:12 UTC Modified: 2001-07-19 04:31 UTC
From: soenke at topconcepts dot com Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 4.0.6 OS: RedHat Linux 7.0
Private report: No CVE-ID: None
 [2001-07-19 04:12 UTC] soenke at topconcepts dot com
Hi there,

not a bug, but a suggestion:

if ($foo==4) $foo=3;

in short form:

$foo==4 ? $foo=3 : 1;

it would be nice if that where possible:

$foo==4 ? $foo=3; (without else string)

i didnt know where to post else. please cc to me cauze i'm not on the list.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-07-19 04:31 UTC] cynic@php.net
please read the trinary op. man page carefully. you obvously misunderstood its purpose.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 09:01:29 2024 UTC