79152337

Date: 2024-11-03 08:47:34
Score: 0.5
Natty:
Report link

When you call a class dynamically this way (e.g., with $class = "AdminController"; followed by new $class();), PHP looks it in the global namespace.

There are two ways of dynamically calling it-

  1. Specify Hardcode Namespace "Base\AdminController" so PHP knows exactly which namespace to look in.

  2. You can use NAMESPACE if you want to dynamically load any class within the same namespace

Reasons:
  • Whitelisted phrase (-1.5): You can use
  • No code block (0.5):
  • Starts with a question (0.5): When you
  • Low reputation (1):
Posted by: Om Prakash Swami