- Output for 5.5.24 - 5.5.30, 5.6.8 - 5.6.16, 7.0.0
- Parse error: syntax error, unexpected 'prefixes' (T_STRING), expecting variable (T_VARIABLE) in /in/rEgba on line 4
Process exited with code 255.
<?php
class G {
public prefixes = array();
public function test($prefix, $baseDir) {
if (!isset($this->prefixes[$prefix])) {
$this->prefixes[$prefix] = [];
}
array_push($this->$prefixes[$prefix], $baseDir);
}
}
$l = new G();
$l->test("a", "b");
var_dump($l);