From:             rolf at winmutt dot com
Operating system: Linux
PHP version:      5CVS-2005-07-29 (dev)
PHP Bug Type:     Scripting Engine problem
Bug description:  Problem with tertiary statement in array

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 bug report at http://bugs.php.net/?id=33921&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=33921&r=trysnapshot4
Try a CVS snapshot (php5.0): 
http://bugs.php.net/fix.php?id=33921&r=trysnapshot50
Try a CVS snapshot (php5.1): 
http://bugs.php.net/fix.php?id=33921&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=33921&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=33921&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=33921&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=33921&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=33921&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=33921&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=33921&r=notwrong
Not enough info:             
http://bugs.php.net/fix.php?id=33921&r=notenoughinfo
Submitted twice:             
http://bugs.php.net/fix.php?id=33921&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=33921&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=33921&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=33921&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=33921&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=33921&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=33921&r=float
No Zend Extensions:          http://bugs.php.net/fix.php?id=33921&r=nozend
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=33921&r=mysqlcfg

Reply via email to