Re: [PHP] using ($test)?$true:$false in a string

2005-11-21 Thread Robert Cummings
On Mon, 2005-11-21 at 10:43, Jochem Maas wrote: > Richard Heyes wrote: > > Robert Cummings wrote: > > > >> On Mon, 2005-11-21 at 10:02, Richard Heyes wrote: > >> > >>> Readability is in the eye of the beholder. > >> > >> > >> > >> But efficiency isn't ;) > > yes it is actually - everything is in

Re: [PHP] using ($test)?$true:$false in a string

2005-11-21 Thread Robert Cummings
On Mon, 2005-11-21 at 10:31, Richard Heyes wrote: > Robert Cummings wrote: > > On Mon, 2005-11-21 at 10:02, Richard Heyes wrote: > > > >>Readability is in the eye of the beholder. > > > > > > But efficiency isn't ;) > > Try measuring the difference between the various methods over a > realisti

Re: [PHP] using ($test)?$true:$false in a string

2005-11-21 Thread Marcus Bointon
On 21 Nov 2005, at 15:43, Jochem Maas wrote: using sprintf() is such a simple case may be excessive BUT I was merely introducing the OP to something new (possibly) - anyone asking such 'simple' questions is not at a stage that this kind of efficiency is an issue (i.e. give them 'whats possibl

Re: [PHP] using ($test)?$true:$false in a string

2005-11-21 Thread Jochem Maas
Richard Heyes wrote: Robert Cummings wrote: On Mon, 2005-11-21 at 10:02, Richard Heyes wrote: Readability is in the eye of the beholder. But efficiency isn't ;) yes it is actually - everything is in the eye of the beholder. it just so happens that we often have consensus ;-) with regar

Re: [PHP] using ($test)?$true:$false in a string

2005-11-21 Thread Richard Heyes
Robert Cummings wrote: On Mon, 2005-11-21 at 10:02, Richard Heyes wrote: Readability is in the eye of the beholder. But efficiency isn't ;) Try measuring the difference between the various methods over a realistic number of iterations, eg. 100. There's little point in going through ones

Re: [PHP] using ($test)?$true:$false in a string

2005-11-21 Thread Robert Cummings
On Mon, 2005-11-21 at 10:02, Richard Heyes wrote: > > Readability is in the eye of the beholder. But efficiency isn't ;) Cheers, Rob -- .. | InterJinn Application Framework - http://www.interjinn.com | :-

Re: [PHP] using ($test)?$true:$false in a string

2005-11-21 Thread Richard Heyes
Robert Cummings wrote: On Mon, 2005-11-21 at 09:42, Chris Boget wrote: and I feel it would be more elegant to be able to do something like: $var ="first part of string {(($a==$b)?$c:$d)} rest of string"; $templateStr = 'first part of string %s rest of string'; $outputStr = sprintf($template

Re: [PHP] using ($test)?$true:$false in a string

2005-11-21 Thread Robert Cummings
On Mon, 2005-11-21 at 09:42, Chris Boget wrote: > >> and I feel it would be more elegant to be able to do something like: > >> $var ="first part of string {(($a==$b)?$c:$d)} rest of string"; > > $templateStr = 'first part of string %s rest of string'; > > $outputStr = sprintf($templateStr, (($a==

Re: [PHP] using ($test)?$true:$false in a string

2005-11-21 Thread Chris Boget
and I feel it would be more elegant to be able to do something like: $var ="first part of string {(($a==$b)?$c:$d)} rest of string"; $templateStr = 'first part of string %s rest of string'; $outputStr = sprintf($templateStr, (($a==$b)?$c:$d)); That is so totally slick! I'm definitely going t

Re: [PHP] using ($test)?$true:$false in a string

2005-11-21 Thread Marcus Bointon
On 18 Nov 2005, at 20:13, Dylan wrote: $var = "first part of string ".(($a==$b)?$c:$d)." rest of string"; and I feel it would be more elegant to be able to do something like: $var ="first part of string {(($a==$b)?$c:$d)} rest of string"; Strange as it may seem, you'll probably find that th

Re: [PHP] using ($test)?$true:$false in a string

2005-11-21 Thread Jochem Maas
Dylan wrote: Hi Is it possible to use the ($test)?$true:$false construction in a (double quoted) string without dropping out of the string and concatenating? I have many lines like: $var = "first part of string ".(($a==$b)?$c:$d)." rest of string"; and I feel it would be more elegant to be abl

Re: [PHP] using ($test)?$true:$false in a string

2005-11-18 Thread Dylan
Richard Lynch wrote: > On Fri, November 18, 2005 2:13 pm, Dylan wrote: >> Is it possible to use the ($test)?$true:$false construction in a >> (double >> quoted) string without dropping out of the string and concatenating? I >> have >> many lines like: >> >> $var = "first part of string ".(($a==$b)

Re: [PHP] using ($test)?$true:$false in a string

2005-11-18 Thread Richard Lynch
On Fri, November 18, 2005 2:13 pm, Dylan wrote: > Is it possible to use the ($test)?$true:$false construction in a > (double > quoted) string without dropping out of the string and concatenating? I > have > many lines like: > > $var = "first part of string ".(($a==$b)?$c:$d)." rest of string"; > >

[PHP] using ($test)?$true:$false in a string

2005-11-18 Thread Dylan
Hi Is it possible to use the ($test)?$true:$false construction in a (double quoted) string without dropping out of the string and concatenating? I have many lines like: $var = "first part of string ".(($a==$b)?$c:$d)." rest of string"; and I feel it would be more elegant to be able to do somethi