PHP OOP: Issues with properties and extended class

Let’s say I have this PHP script: <?php class Aaa { protected $var = null; public function performSomething() { $this->var = ‘Now we have a string, not more null value’; $bbb = New Bbb(); $bbb->powerOnYou(); } } class Bbb extends Aaa { public function powerOnYou() { var_dump($this->var); // this dump “NULL” and not string } } $aaa = New Aaa();…
Read more

Avoiding semantic coupling with Java Collection interfaces

These days I am reading the Code Complete book and I’ve passed the part about coupling-levels (simple-data-parameter, simple-object, object-parameter and semantic coupling). Semantic being the “worst” kind: The most insidious kind of coupling occurs when one module makes use not of some syntactic element ofanother module but of some semantic knowledge of another module’s inner workings. The examples in the…
Read more

Send Mail Php oop [duplicate]

This question already has an answer here: PHP mail form doesn’t complete sending e-mail 8 answers I plan to create a contact form. The validation errors are operating at 100% but when there is no error when sending can not receive email and do not know why. I’ve tried several ways someone can help me. The code is this: CONTACT:…
Read more