首页 > Web开发 > 详细

php-constant

时间:2018-11-24 12:33:42      阅读:141      评论:0      收藏:0      [点我收藏+]
<?php

/**
 * @Author: cyany_blue
 * @Date:   2018-11-24 10:30:15
 * @Last Modified by:   cyany_blue
 * @Last Modified time: 2018-11-24 10:53:36
 */
define("name", ‘just is a constant‘);
echo name."<br>";
echo constant(‘name‘).‘<br>‘;
echo __LINE__.‘<br>‘;  //The current line number 
echo __FILE__.‘<br>‘;//the current filename
function abc(){

    echo __FUNCTION__.‘<br>‘;//echo function name
}
abc();
class a{
    function __construct(){
        echo __CLASS__.‘<br>‘; //current class name
        echo ".‘<br>1354<br>‘;";
    }
    public function abc(){
        echo ‘function name<br>‘;
        echo __METHOD__.‘<br>‘;//current method name

    }
}
$abcd =new a();
$abcd->abc();
echo ‘---------------‘;


技术分享图片

php-constant

原文:https://www.cnblogs.com/cyany/p/10011347.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!