Checkboxes creating a funny loop with input values (Possible Bug) or Improvement

When using the array.

///Update: $array = array(‘green’ => ‘blue’, ‘tan’=> ‘red’, ‘red’ => ‘green’, ‘pink’ => ‘red’, ‘pink2’ => ‘red’, ‘pink22’ => ‘red’, ‘pink22’ => ‘red’, ‘pink3234’ => ‘red’, ‘pink23423’ => ‘red’, ‘pink434’ => ‘red’, ‘pink343’ => ‘red’, ‘pink34333’ => ‘red’, ‘pink43434f’ => ‘red’);

  • If the array $key is anything other then a number. Checkboxes slows way down with it’s processing of the array. Even this array runs slow.

// To many results will cause this to bug out. I have a different array than this where the $keys are not numbers.

$array = array(0 => ‘blue’, 1 => ‘red’, 2 => ‘green’, 3 => ‘red’);

If I use select box, or radio box and print_r($array);

it shows this.

Array ( [0] => blue [1] => red [2] => green [3] => red )

When I use checkboxes it does this.

Array ( [0] => blue [1] => red [2] => green [3] => red ) Array ( [0] => blue [1] => red [2] => green [3] => red ) Array ( [0] => blue [1] => red [2] => green [3] => red ) Array ( [0] => blue [1] => red [2] => green [3] => red ) Array ( [0] => blue [1] => red [2] => green [3] => red ) Array ( [0] => blue [1] => red [2] => green [3] => red ) Array ( [0] => blue [1] => red [2] => green [3] => red ) Array ( [0] => blue [1] => red [2] => green [3] => red ) Array ( [0] => blue [1] => red [2] => green [3] => red ) Array ( [0] => blue [1] => red [2] => green [3] => red ) Array ( [0] => blue [1] => red [2] => green [3] => red ) Array ( [0] => blue [1] => red [2] => green [3] => red ) Array ( [0] => blue [1] => red [2] => green [3] => red )

class MyPlugin {

    static function getpermissionslist() {
        $array = array(0 => 'blue', 1 => 'red', 2 => 'green', 3 => 'red');
        print_r($array);
}
  }

YAML

bestband:
    label: Best Band Ever
    type: controlledcheckboxes
    controller: MyPlugin::getpermissionslist

I’m using this plugin. https://github.com/rasteiner/controlledlist

it has this class

class ControlledcheckboxesField extends CheckboxesField {
	public function options() {
		return call_user_func($this->controller, $this);
	}
}

I can’t reproduce this, both arrays work fine in my installation, tested with Kirby 2.5.7

What Kirby version are you using?

Toolkit version: 2.5.6
Kirby version: 2.5.6
Panel version: 2.5.6