News for hackers. Stuff that matters.
Re:PHP 5.5.5 Released by qnk on Thursday October 17, 2013 @08:45AM (#6564971)
This is just a maintenance release. If you want to see what's coming to PHP for the next feature-release version, check the RFC wiki at https://wiki.php.net/rfc

So far, these features will probably make it to version 5.6:

  * Internal Operator Overloading
  * Variadic functions
Re:PHP 5.5.5 Released by rbmoshe on Thursday October 17, 2013 @09:09AM (#6565069)
> Variadic functions

Doesn't PHP have that already? http://us2.php.net/func_get_args

Edit - Checking out that parent link it seems: Currently variadic functions are implemented by fetching the function arguments using func_get_args(). The following code sample shows an implementation of a variadic function used to prepare and execute a MySQL query (I'll be making use of this example throughout the RFC):

Firstly, by just looking at the function signature public function query($query) you cannot know that this is actually a variadic function. You'd think that the function can only run a normal query and doesn't support bound parameters:

  public function query($query, ...$params) { /*...
  $userData = $db->query('SELECT * FROM users WHERE id = ?', $userID)->fetch();
Re:PHP 5.5.5 Released by TazeTSchnitzel on Thursday October 17, 2013 @09:19AM (#6565119)
There's a counterpart unpacking syntax which will likely also get merged in, meaning you can have:

  function query($query, ...$params) {}
and

  $params = [3];
  query('SELECT * FROM table WHERE a = ?;', ...$params);
Re:PHP 5.5.5 Released by sinofer on Thursday October 17, 2013 @01:26PM (#6566767)
Importing namespaced functions is also a nice addition and has been accepted! Although its not included in 5.6 yet.
Re:PHP 5.5.5 Released by borplk on Thursday October 17, 2013 @09:05AM (#6565044)
> Operator Overloading

That's scary

Re:PHP 5.5.5 Released by TazeTSchnitzel on Thursday October 17, 2013 @09:16AM (#6565108)
It's for internal PHP runtime use only. IIRC we're adding it so that our bignum library is nicer to use.