Forum Moderators: coopster

Message Too Old, No Replies

Hello, anyone have tried php5.3's namespace?

         

yarco

4:21 am on Jul 8, 2009 (gmt 0)

10+ Year Member



Do i need to include first and then use 'use' keyword?

Abc.php
<?php
namespace yarco\test;
class Abc
{
}
?>

test.php
<?php
include 'Abc.php';
use yarco\test\Abc;

$o = new Abc;
?>

?Why not python's import?

coopster

12:14 pm on Jul 9, 2009 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld, yarco.

The "use" is the import (or alias).

[php.net...]
[php.net...]