get_class_vars() is broken in PHP 7.4 with opcache enabled, so stop using it

looks like this fix actually works with PHP 5.2 after all, so not dropping backwards compatibility
resolves #64
This commit is contained in:
Sergey Tsalkov
2020-07-10 00:00:27 +00:00
parent 226a08611f
commit fa46824df1

View File

@@ -164,11 +164,9 @@ class MeekroDB {
// suck in config settings from static class // suck in config settings from static class
public function sync_config() { public function sync_config() {
$db_class_vars = get_class_vars('DB'); // the DB::$$var syntax only works in 5.3+
foreach (DB::$variables_to_sync as $variable) { foreach (DB::$variables_to_sync as $variable) {
if ($this->$variable !== $db_class_vars[$variable]) { if ($this->$variable !== DB::$$variable) {
$this->$variable = $db_class_vars[$variable]; $this->$variable = DB::$$variable;
} }
} }
} }