On Thu, Apr 30, 2020 at 1:12 PM Ryan Jentzsch
wrote:
> Is there a possibility this can be fixed in version 8? From
> http://phpsadness.com/sad/30 listed as an outright bug (I don't have
> the C skills to fix this. I am just raising this as an issue that has
> been a criticism of PHP for many year
Is there a possibility this can be fixed in version 8? From
http://phpsadness.com/sad/30 listed as an outright bug (I don't have
the C skills to fix this. I am just raising this as an issue that has
been a criticism of PHP for many years now with a new major version
upcoming that could allow for a
Hi!
On 10/18/11 2:43 PM, Alain Williams wrote:
It probably does, but it is quite subtle. I was expecting the above to work
since
it does in C -- although in C&variable is an address which can be used in an
expression ... the PHP '&' operator is different, in spite of apparent
similarities.
A
On Tue, Oct 18, 2011 at 10:09:37PM +0200, Arnaud Le Blanc wrote:
> Hi,
>
> Le Monday 17 October 2011 15:07:30, Alain Williams a écrit :
> > On Fri, Oct 14, 2011 at 08:08:56PM +0200, Arnaud Le Blanc wrote:
> > > Hi,
> > >
> > > I've already posted this patch and it has since been reviewed and
> >
Hi,
Le Monday 17 October 2011 15:07:30, Alain Williams a écrit :
> On Fri, Oct 14, 2011 at 08:08:56PM +0200, Arnaud Le Blanc wrote:
> > Hi,
> >
> > I've already posted this patch and it has since been reviewed and
> > improved. I'm re-posting it for discussion before eventually commiting
> > it.
On Fri, Oct 14, 2011 at 08:08:56PM +0200, Arnaud Le Blanc wrote:
> Hi,
>
> I've already posted this patch and it has since been reviewed and improved.
> I'm re-posting it for discussion before eventually commiting it.
>
> The ternary operator always copies its second or third operand, which is v
2011/10/17 Ilia Alshanetsky :
> Seems like a good patch, +1 from me on inclusion into 5.4/HEAD.
>
> On Fri, Oct 14, 2011 at 2:08 PM, Arnaud Le Blanc wrote:
>> Hi,
>>
>> I've already posted this patch and it has since been reviewed and improved.
>> I'm re-posting it for discussion before eventually
Seems like a good patch, +1 from me on inclusion into 5.4/HEAD.
On Fri, Oct 14, 2011 at 2:08 PM, Arnaud Le Blanc wrote:
> Hi,
>
> I've already posted this patch and it has since been reviewed and improved.
> I'm re-posting it for discussion before eventually commiting it.
>
> The ternary operator
Hi,
I've already posted this patch and it has since been reviewed and improved.
I'm re-posting it for discussion before eventually commiting it.
The ternary operator always copies its second or third operand, which is very
slow compared to an if/else when the operand is an array for example:
$
I should mention the more general use cases of the function I had made:
ifset($arr, $key1, $key2, ..., $keyN, $default)
actually, this function checks with array_key_exists, and not just isset.
Meaning, if the value exists at that array key path and is null, it is used,
otherwise, $default is u
Hi,
I wouldn't really worry about the ternary operator too much. These kinds of
micro optimizations really only appear to make a difference in contrived
benchmarks and usually aren't the norm in real life applications. However,
with that said, an optimization is an optimization. Optimizations like
Time:
$arr = range(0, 100); // 0.6367609500885
$foo == true ? $foo = $arr : NULL; // 3.0994415283203E-06
if (true) $foo = $arr; else $foo = NULL; // 2.8610229492188E-06
PHP 5.1.6
Olafur Waage
On Sun, Dec 14, 2008 at 9:30 PM, David Grudl wrote:
>
> Původní zpráva
> Od: Ilia
Původní zpráva
Od: Ilia Alshanetsky
While it is slower due to the use of temp vars, in my experience
unless you have a few hundred operations involving ternary operator
you cannot even see the difference. Even then there are typically way
more important areas of code that ne
While it is slower due to the use of temp vars, in my experience
unless you have a few hundred operations involving ternary operator
you cannot even see the difference. Even then there are typically way
more important areas of code that need to be optimized. The only time
you can really tel
On Sun, Dec 14, 2008 at 8:06 PM, David Grudl wrote:
> Hello,
>
> ternary operator is very nice syntactic sugar...
>
> $foo = $cond ? $bar : $baz;
>
> ...but it may slows down scripts. When $bar is array or relative big string,
> it is better to aviod sugar and use if:
>
> if ($cond) $foo = $ba
Hello,
ternary operator is very nice syntactic sugar...
$foo = $cond ? $bar : $baz;
...but it may slows down scripts. When $bar is array or relative big
string, it is better to aviod sugar and use if:
if ($cond) $foo = $bar; else $foo = $baz;
and reference counting will be used.
I do
16 matches
Mail list logo