PHP 8.3 Compatibility Issue in ZenDB/Config.php

2 posts by 2 authors in: Forums > CMS Builder
Last Post: Yesterday at 7:21pm   (RSS)

I was doing some updates on a website and Claude Code insisted on running some checks first and came back with this. 

PHP 8.3 Compatibility Issue in ZenDB/Config.php

File: cmsb/lib/ZenDB/Config.php

Issue: The variable variable syntax self::${$key} is deprecated in PHP 8.2+ and will be removed in PHP 9.0.

Affected lines:

  • Line 40:return self::${$key};
  • Line 53:$config[$key] = self::${$key};
  • Line 80:self::${$key} = $value;

Recommended fix: Replace with Reflection-based access for static properties:

// Line 40 - in get() method
$reflectionProperty = new \ReflectionProperty(__CLASS__, $key);
return $reflectionProperty->getValue(null);

// Line 53 - in getAll() method
$reflectionProperty = new \ReflectionProperty(__CLASS__, $key);
$config[$key] = $reflectionProperty->getValue(null);

// Line 80 - in set() method
$reflectionProperty = new \ReflectionProperty(__CLASS__, $key);
$reflectionProperty->setValue(null, $value);

Reference: https://wiki.php.net/rfc/deprecate_dollar_brace_string_interpolation


Bottom line: Nothing breaks. It's just noisy in your logs until the developer fixes it.

The code won't actually break until PHP 9.0 (which is likely 2-3 years away).

Thanks,

Kenny H