namespace user\login\SystemCommand; class Command extends SystemCommand { ... private function transaction (){ ... $date = new DateTime(); $date->add(DateInterval::createFromDateString('yesterday')); $time = $date->format(\DateTime::RFC3339); ... } ... echo $this->yad_transaction(); } 

Why a PHP error occurs Fatal error: Class 'user \ login \ SystemCommand \ DateTime' not found in ...

  • one
    $date = new \DateTime(); - add slash - splash58
  • @ splash58, can you explain what it means? - user254893
  • as I understand it, the global namespace. Now you ’ll look for class - splash58

0