Created
June 19, 2016 00:54
-
-
Save astorm/0e412fb15b77b26883de909a5d7ed929 to your computer and use it in GitHub Desktop.
This file contains 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 Foo | |
{ | |
protected $default='default'; | |
public function test() | |
{ | |
$this->default = 'not default'; | |
echo $this->addChild(),"\n"; | |
} | |
protected function addChild($level=0) | |
{ | |
if($level > 10) | |
{ | |
return 'Done'; | |
} | |
$level++; | |
echo "Incremeneted to $level\n"; | |
echo ' ' , $this->default,"\n"; | |
return self::addChild($level); | |
} | |
} | |
$object = new Foo; | |
$object->test(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment