自 PHP 5.5 起,关键词 class 也可用于类名的解析。使用 ClassName::class 你可以获取一个字符串,包含了类 ClassName 的完全限定名称。这对使用了 命名空间 的类尤其有用。

Example #7 类名的解析

<?php namespaceNS{ classClassName{ }

echoClassName::class; } ?>

以上例程会输出:

NS\ClassName

随机推荐

  1. js原生动态创建表格

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  2. Nginx的configure各项中文说明

    –prefix=<path> – Nginx安装路径.如果没有指定,默认为 /usr/local/nginx. –sbin-path=<path> – Nginx可执行文件安装 ...

  3. A - 畅通工程续 最短路

    某省自从实行了很多年的畅通工程计划后,终于修建了很多路.不过路多了也不好,每次要从一个城镇到另一个城镇时,都有许多种道路方案可以选择,而某些方案要比另一些方案行走的距离要短很多.这让行人很困扰. 现在 ...

  4. Jenkins的环境部署

    一.Tomcat环境安装 1.安装JDK(Java环境) JDK下载地址:https://www.oracle.com/technetwork/java/javase/downloads/index. ...

  5. tushare 开源数据包的使用

    tushare 使用 python开源金融接口包: tushare.org/trading.html#d2 安装: pip install tushare import tushare as ts # ...

  6. P1563 玩具谜题(简单模拟)

    就是一个简单模拟 #include<iostream> #include<string> using namespace std; ; int in[maxn], x[maxn ...

  7. 定义静态map

    public final static Map<String, String> header = new HashMap<String, String>(); static { ...

  8. Python学习笔记(3)-字符串

    创建字符串 一对单引号或双引号 >>> 'hello world' 'hello world' >>> "hello world" 'hello ...

  9. 深度学习框架PyTorch一书的学习-第六章-实战指南

    参考:https://github.com/chenyuntc/pytorch-book/tree/v1.0/chapter6-实战指南 希望大家直接到上面的网址去查看代码,下面是本人的笔记 将上面地 ...

  10. Android APP性能测试笔记(一)

    Android APP性能测试笔记(一) (1)工具使用   Android Studio  GT, root的真机 (2)记录apk大小(对比竞品)   使用Android Studio导入需要测试 ...