This commit is contained in:
2025-05-10 14:10:37 +02:00
parent cfb0d1fdc9
commit 64b7c08f58
5 changed files with 81 additions and 12 deletions

View File

@ -6,8 +6,8 @@ class Trie implements ArrayAccess, IteratorAggregate, Countable {
private $nb_branches = 0;
public function arraySet($cles, $valeur) {
$this->nb_branches++;
$cle = $cles[0];
$this->nb_branches++;
$cles = array_slice($cles, 1);
if ($cles == []) {
$this->branches[$cle] = $valeur;