How to access member functions of another class in PHP

巴扎黑
Release: 2016-11-24 11:23:49
Original
1595 people have browsed it

Write a static method in the category to return the $ A instance, call


Class Instance {
Private Static $ A; $a=new a(); }

class b{
function itb(){
  // Obtain the single instance of a here, and there will be no multiple instantiations
  $a=instance::getA();  
  $a->ita();
}

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template