php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #35858 echo ternaries problem
Submitted: 2005-12-31 13:33 UTC Modified: 2005-12-31 13:36 UTC
From: mattias dot segerdahl at bitcom dot se Assigned:
Status: Not a bug Package: *General Issues
PHP Version: 5.1.1 OS: Mandriva latest
Private report: No CVE-ID: None
 [2005-12-31 13:33 UTC] mattias dot segerdahl at bitcom dot se
Description:
------------
Echo without ternaries disregards some output

Reproduce code:
---------------
$true = true; echo "Is this true or false : " . $true?'true':'false';

Expected result:
----------------
Is this true or false : true

Actual result:
--------------
true

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-12-31 13:36 UTC] mattias dot segerdahl at bitcom dot se
Didn't see the concatination.. sorry for the bugreport
 [2005-12-31 13:36 UTC] derick@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

. precedes ?: and thus the concattenation is done first.
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Wed Oct 07 21:00:02 2026 UTC