php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #33921 Problem with tertiary statement in array
Submitted: 2005-07-29 19:05 UTC Modified: 2005-07-29 21:02 UTC
From: rolf at winmutt dot com Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 5CVS-2005-07-29 (dev) OS: Linux
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: rolf at winmutt dot com
New email:
PHP Version: OS:

 

 [2005-07-29 19:05 UTC] rolf at winmutt dot com
Description:
------------
The following line was not being interpreted properly in php5-STABLE-200505181234:

new HTML('a',array('href'=>'?action=addService&billed_services[account_id]='. $_REQUEST['billed_services']['account_id']?$_REQUEST['billed_services']['account_id'] : $_REQUEST['accounts']['id']),'Add Service');


The array href element value was being passed as NULL, I corrected by adding () around the tertiary statement :

new HTML('a',array('href'=>'?action=addService&billed_services[account_id]='. ($_REQUEST['billed_services']['account_id']?$_REQUEST['billed_services']['account_id']:$_REQUEST['accounts']['id'])),'Add Service');


Reproduce code:
---------------
new HTML('a',array('href'=>'?action=addService&billed_services[account_id]='. $_REQUEST['billed_services']['account_id']?$_REQUEST['billed_services']['account_id'] : $_REQUEST['accounts']['id']),'Add Service');

Expected result:
----------------
array('href'=>'?action=addService&billed_services[account_id]='.either or val)

Actual result:
--------------
array('href'=>NULL)

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-07-29 21:02 UTC] sniper@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php


 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sun Jul 20 03:00:03 2025 UTC