The link below refers to a PHP Coalesce function and changes in PHP 5.3.
http://stackoverflow.com/questions/1013493/coalesce-function-for-php

function coalesce() {
  $args = func_get_args();
  foreach ($args as $arg) {
    if (!empty($arg)) {
      return $arg;
    }
  }
  return NULL;
}

Initialising variables using above will be good ad consistent instead of the 
ubiquitious "if" for each chaeck and assignment.
PHP 5.3 has the coalesce operator "?:" tha can be used like:
echo $a ?: $b ?: $c ?: $d;
The first non empty variable is echoed.

Regards,
Ap.Muthu



> I made some changes in the db as well, can someone other than me please
> test if it is working? Well, here it is working, but a test should not
> be done from the one who did the change.
>
> Changes:
> Revision: 6699
> -> fix: Field PID is now unsigned and now a FK to care_person.pid
> Revision: 6697
> -> default charset of all tables is now UTF8
> Revision: 6696
> -> care_person tablefix: PID was PK and Index as well!
>
> And some clean-up's in the files of unsigned variables (not finished)



------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
Care2002-developers mailing list
Care2002-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/care2002-developers

Reply via email to