In PHP (version 7.1), I am attempting to use a MAP as opposed to a two dimensional array to handle implicit data type conversion across different data type groups. However, I am receiving the following run-time error:
Class ‘DsMap’ not found
The error occurs on this line of code:
protected $hive_data_type_group_map = new DsMap();
I have checked online, but there is little documentation on DsMap, even on PHP’s website (click here). Does anyone know how to fix this?
3
Answers
Data Structures is not a built-in PHP extension.
It needs to be installed before use. The installation instructions are available on php.net.
For windows
Download compiled-dll file “php_ds.dll” from https://pecl.php.net/package/ds. Place it in your dir wampbinphp[your_php_version_folder]ext and include it in your “.ini” file.
It worked for me.
the easiest way on ubuntu:
Reference: https://www.php.net/manual/en/ds-deque.allocate.php