Last active
December 17, 2015 22:39
-
-
Save TrafeX/5683430 to your computer and use it in GitHub Desktop.
This causes a segmentation fault in PHP 5.4.11
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 example | |
{ | |
private $instance; | |
public function getInstance() | |
{ | |
// Lazy load the instance | |
if (null === $this->instance) { | |
$this->instance = new example(); | |
} | |
return $this->instance; | |
} | |
public function test() | |
{ | |
// This creates a loop | |
$this->getInstance()->test(); | |
} | |
} | |
$c = new Example(); | |
$c->test(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment