TalkPHP

TalkPHP (http://www.talkphp.com/forums.php)
-   General (http://www.talkphp.com/general/)
-   -   When will php5.3.0 release? (http://www.talkphp.com/general/2083-when-will-php5-3-0-release.html)

Nor 01-24-2008 08:50 PM

When will php5.3.0 release?
 
I just can't wait to use namespaces :)....

danielneri 01-24-2008 09:10 PM

What exactly are namespaces anyway?

Alan @ CIT 01-24-2008 09:11 PM

There is no set release date yet as far as I know but I would guess at March/April by the time it's got through QA, betas and RC's - perhaps even later.

Alan

Nor 01-24-2008 09:14 PM

man php5.3 is going to be so useful :D.... this will make coding more interesting to be honest, you never know whats in store. (plus this topic will be #1 in google search O_o heh :))...

danielneri 01-24-2008 09:19 PM

I read up on namespaces, although how exactly are they more useful?

Orc 01-24-2008 11:53 PM

Why do we need Namespaces again?

The only types of namespaces I've worked with were in C++ and that was simply
Code:

#include <iostream>
using namespace std;
// Though you could do the same by putting every single line a std::, some //programmers sometimes use this cause it's lesser bytes of data

In php, though:
PHP Code:

<?php
namespace A;
?>

Never used them myself

TlcAndres 01-25-2008 01:02 AM

As I understand it provides a more generalized body for classes like

PHP Code:

namespace DB;

class 
mysql
{
   function 
blah()
   {}
}

class 
sqlite
{
  function 
blah()
  {}
}

echo 
DB::mysql::blah(); 


xenon 01-25-2008 07:52 AM

quick example:

PHP Code:

namespace DB_MySQL
{
    class 
DB { ... }
}

namespace 
DB_Postgre
{
    class 
DB { ... }



and some sort of usage:

PHP Code:

if( driver == 'postgre' ) use namespace DB_Postgre;
else use namespace 
DB_MySQL;

$db = new DB();
[
more stuff


This is just a prototype of what can be done.


All times are GMT. The time now is 03:36 PM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0