Railsbin – The vulnerable pastebin service!

User:

Title: PHP REF

Content:

<?php
class B
{

    private $form;

    public function getForm()
    {
        if (! $this->form)
            $this->form = new B();
        return $this->form;
    }

    public function foo()
    {
        $this->form = $this->getForm();
        echo spl_object_hash($this->form) . "<br/>\n";
    }
}

$b = new B();
$b->foo();
$b->foo();
$b->foo();

Edit | Back