On Sun, Dec 14, 2008 at 8:06 PM, David Grudl <da...@grudl.com> 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 = $bar; else $foo = $baz; > > and reference counting will be used. > > I don't know how difficult it is to implement, but it can be very useful > speed optimization for PHP 5.3 to improve ternary operator to use reference > counting.
Do you have any numbers? -- Alexey Zakhlestin http://www.milkfarmsoft.com/ -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php