简介本文主要罗列些例子,看看当php类名和函数名重名时,php是如何处理的例子<?php class TestObject{ public $subject; private $message = 'test' . PHP_EOL; public function testObject() { echo $this->message; }} $instance = new TestObject();$instance->testobject();输出php test1.php testt…
Introduction Before .NET, we were always looking for a way to log current method name in a log file for better logging. But, there were no functionalities that could have helped in this, and it was left as an uncompleted job. But, with .NET, we could…
//php 5.6class father{ public function __construct() { echo __METHOD__; }} class son extends father{ //public function __construct() { // parent::__construct(); // echo __METHOD__; //} //方法名同类名相同如果没有__construct,会被当做构造函数.如果被当做构造函数,没有parent::__construc…