Skip to main content
added 17 characters in body
Source Link
milan
  • 2.2k
  • 9
  • 25
  • 34

If I call "myClass::getItems()" from the "workingCLass" which getId method will be called? The one that echos "hello" or "bye"? Thank you.

class myClass extends otherClass { function getId(){ echo "hello"; } } class otherClass{ function getItems(){ $this->getId(); } function getId(){ echo "bye"; } } class workingClass extends myClass { function __construct(){ $this->getItems(); } } 

If I call "myClass::getItems()" from the "workingCLass" which getId method will be called? The one that echos "hello" or "bye"? Thank you.

class myClass extends otherClass { function getId(){ echo "hello"; } } class otherClass{ function getItems(){ $this->getId(); } function getId(){ echo "bye"; } } class workingClass{ function __construct(){ $this->getItems(); } } 

If I call "myClass::getItems()" from the "workingCLass" which getId method will be called? The one that echos "hello" or "bye"? Thank you.

class myClass extends otherClass { function getId(){ echo "hello"; } } class otherClass{ function getItems(){ $this->getId(); } function getId(){ echo "bye"; } } class workingClass extends myClass { function __construct(){ $this->getItems(); } } 
deleted 2 characters in body
Source Link
milan
  • 2.2k
  • 9
  • 25
  • 34

If I call "myClass::getItems()" from the "workingCLass" which getId method will be called? The one that echos "hello" or "bye"? Thank you.

class myClass extends otherClass { function getId(){ echo "hello"; } } class otherClass{ function getItems(){ $this->getId(); } function getId(){ echo "bye"; } } class workingClass{ function __construct(){ myClass::getItems$this->getItems(); } } 

If I call "myClass::getItems()" from the "workingCLass" which getId method will be called? The one that echos "hello" or "bye"? Thank you.

class myClass extends otherClass { function getId(){ echo "hello"; } } class otherClass{ function getItems(){ $this->getId(); } function getId(){ echo "bye"; } } class workingClass{ function __construct(){ myClass::getItems(); } } 

If I call "myClass::getItems()" from the "workingCLass" which getId method will be called? The one that echos "hello" or "bye"? Thank you.

class myClass extends otherClass { function getId(){ echo "hello"; } } class otherClass{ function getItems(){ $this->getId(); } function getId(){ echo "bye"; } } class workingClass{ function __construct(){ $this->getItems(); } } 
Source Link
milan
  • 2.2k
  • 9
  • 25
  • 34

php multiple classes and methods with same name

If I call "myClass::getItems()" from the "workingCLass" which getId method will be called? The one that echos "hello" or "bye"? Thank you.

class myClass extends otherClass { function getId(){ echo "hello"; } } class otherClass{ function getItems(){ $this->getId(); } function getId(){ echo "bye"; } } class workingClass{ function __construct(){ myClass::getItems(); } }