#33921 [Opn->Bgs]: Problem with tertiary statement in array

From: Date: Fri, 29 Jul 2005 19:02:27 +0000
Subject: #33921 [Opn->Bgs]: Problem with tertiary statement in array
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-82695@lists.php.net to get a copy of this message
ID: 33921 Updated by: sniper@php.net Reported By: rolf at winmutt dot com -Status: Open +Status: Bogus Bug Type: Scripting Engine problem Operating System: Linux PHP Version: 5CVS-2005-07-29 (dev) New Comment: 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 Previous Comments: ------------------------------------------------------------------------ [2005-07-29 19:05:36] 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) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=33921&edit=1

« previous php.bugs (#82695) next »