This f***ing annoying error won't go away, I tried different methods and it's still happening... Code: PocketMine-MP Crash Dump Sat Dec 12 18:58:54 AKST 2015 Error: Can't use method return value in write context File: /BeastHub/src/xbeastmode/beasthub/BeastHub Line: 75 Type: E_COMPILE_ERROR THIS CRASH WAS CAUSED BY A PLUGIN Code: [66] [$cfa[$world][$hub]["X"] => $player->getX(), $cfa[$world][$hub]["Y"] => $player->getY(), $cfa[$world][$hub]["Z"] => $player->getZ()]); [67] $this->getConfig()->save(); [68] } [69] /** [70] * @param $world [71] * @param $hub [72] */ [73] public function deleteHub($world, $hub) [74] { [75] unset($this->getConfig()->getAll()[$world][$hub]); [76] $this->getConfig()->save(); [77] } [78] /** [79] * @param CommandSender $issuer [80] * @param Command $cmd [81] * @param $alias [82] * @param array $param [83] * @return bool|void [84] */ [85] public function onCommand(CommandSender $issuer, Command $cmd, $alias, array $param)
Are $world and $hub both supposed to be strings? And why not simply use Config->remove($key) instead of unset(Config->getAll()[$key])?
Try this PHP: $config = $this->getConfig()->getAll();unset($config[$world][$hub]);$this->getConfig()->setAll($config);$this->getConfig()->save();
You cannot unset directly because getAll() doesn't return by reference. But you can unset directly for get(), which returns by reference.