Created
June 22, 2011 16:37
-
-
Save devdave/1040493 to your computer and use it in GitHub Desktop.
I am in hell
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Parent { | |
public $auto_render = true; | |
public function after(){ | |
echo ($this->auto_render ? "true" : "false"), \n; | |
} | |
} | |
class Child extends Parent { | |
function action_thing(){ | |
$this->auto_render = false; | |
} | |
} | |
/** | |
execution path | |
$newInstance = new Child(); | |
//auto_render = true | |
$newInstance->action_thing(); | |
//Child::$auto_render = false WHILE Parent::$auto_render = true | |
$newInstance->after(); | |
//True |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment