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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
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 May 06 01:01:30 2025 UTC