2

how I can use array access with my static class? F.e. I like to execute next script:

class A {
   ...
}
A['p'] = 15;
echo isset(A['p']) ? A['p'] : 0;
1
  • Can you elaborate on what your question is asking? It's very unclear to me. Commented Apr 4, 2010 at 17:06

2 Answers 2

12

The interface ArrayAccess only works for objects. There's nothing similar for static access.

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

Comments

1

You can make your class a singleton class then you can access it as static class

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.