On 10/14/2011 10: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 always copies its second or third operand, which is
very
slow compared to an if/else when the operand is an array for example: ...
Same "copy always" behavior is made with string in ternary operator, and
it can be
also very annoying e.g:
$content =
file_get_contents('http://www.w3.org/TR/2011/WD-html-markup-20110525/spec.html');
$test = $content !== false ? $content : '';
Is this case also solved with your patch or huge strings are still problem
with a ternary "copy always" functionality? Maybe it's more rare case then
array.
P.S: Sorry I don't test it directly with beta2, I have no place to test.
M. Kubelik
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php