php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #10309 feature request
Submitted: 2001-04-12 15:26 UTC Modified: 2001-06-20 14:37 UTC
From: fabiankessler at usa dot net Assigned:
Status: Closed Package: Feature/Change Request
PHP Version: 4.0.4 OS: all
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: fabiankessler at usa dot net
New email:
PHP Version: OS:

 

 [2001-04-12 15:26 UTC] fabiankessler at usa dot net
$a = 'foo';
$b = 'bar';

$c = (true) ? &$a : &$b;

=> syntax error, have to do

if (true) {
  $c = &$a;
} else {
  $c = &$b;
}

would be nice :)

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-06-17 04:45 UTC] jmoore@php.net
try:

$c =& (true)? $a: $b;

might work better. Havnt tested it though.
 [2001-06-20 14:37 UTC] fabiankessler at usa dot net
no, gives a syntax error also. 
PHP Version 4.0.7-dev (and 4.0.5)
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue Jul 01 00:01:36 2025 UTC