Blogger Information
Blog 42
fans 3
comment 2
visits 40602
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
use 导入空间
虞者自愚的博客
Original
919 people have browsed it

SmallCar.php

实例

<?php
namespace SmallCar;

class Demo
{
    public $name = '宝马';
}

运行实例 »

点击 "运行实例" 按钮查看在线实例


Car.php

实例

<?php
namespace Car;
require 'SmallCar.php';
use Car\Demo as Demo1;
class Demo
{
    public $name = '奔驰';
}
echo (new Demo1) ->name,'<br>';
echo (new Demo()) ->name,'<br>';

运行实例 »

点击 "运行实例" 按钮查看在线实例


如果当前类也有一个同名的类,为导入的类取一个别名


Correction status:qualified

Teacher's comments:
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post