0

I just copied singleton template from phptherightway

I use PHP 5.6.3 (cli) And I got this error:

singleton error

Can somebody explain this ?

1 Answer 1

1

It's the late static binding against a private property that's causing the problems.

Either modify the visibility of $instance to protected

Or modify the references to static::$instance in getInstance() to self::$instance

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.