Blogger Information
Blog 48
fans 3
comment 1
visits 37722
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
命名空间的引入——2018年5月08日
JackBlog
Original
482 people have browsed it




point.php实例

<?php

namespace point
{
    require 'road.php';
    use road\Point as newpoint;
    class Point
    {
        public $pointName;

        function __construct($pointName)
        {
            $this->pointName = $pointName;
            return $this->pointName;
        }

    }
    echo (new newpoint('青园路日辉路'))->pointName;
}

运行实例 »

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

road.php实例

<?php
namespace road
{
    class Point
    {
        public $pointName;

        function __construct($pointName)
        {
            $this->pointName = $pointName;
            return $this->pointName;
        }
    }
}

运行实例 »

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


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