Olav Mørkrid wrote:
i didn't know about empty. thanks!

do you have a link to this new php 6 ? : convention?

I haven't seen any documentation yet but it currently operates like:
($a ?: $b) === (empty($a) ? $b : $a)
with the exception that if $a is unset then an E_NOTICE error is raised.

It remains to be seen in the final version whether that notice is raised or that this operator exists at all

Arpad
it would be great if php 6 could have a solution for this. php is
sweet when it's compact!

On 18/07/07, Arpad Ray <[EMAIL PROTECTED]> wrote:

You can use empty() to take one of them out, since "0" is presumably
also not a desired input:

$language = empty($_SERVER['HTTP_ACCEPT_LANGUAGE'])
    ? "*"
    : $_SERVER['HTTP_ACCEPT_LANGUAGE'];

There's a new ?: operator in PHP 6 which will make that even shorter,
however unlike empty(), it currently throws a notice with unset operands.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to