Fatal error: Uncaught Error: Class 'Ds\Map' not found PHP

Viewed 358

I have the following problem in PHP. In advance forgive me for my poor English.

I want to use the class Map in PHP, so I have installed the package php-ds/php-ds via composer. It installed perfectly, but when I use the class map, it produces an error.

SPECS PHP 7.4.0

CODE

<?php

$map = new \Ds\Map(["a" => 1, "b" => 2, "c" => 3]);

var_dump($map->get("a"));      
var_dump($map->get("d", 10));   
?>

ERROR enter image description here

PROYECT STRUCTURE enter image description here

1 Answers

He forgot to include the autoload file:

require_once("vendor/autoload.php");
Related