PHP code example of joelharkes / data-structures
1. Go to this page and download the library: Download joelharkes/data-structures library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
joelharkes / data-structures example snippets
$set = new \DataStructures\Set\Set();
$set->getIterator()
->filter(fn($value) => $value === 1)
->map(fn($value) => $value === 1)
->count(); // or all(), any().