PHP 8.3 Compatibility Issue in ZenDB/Config.php

2 posts by 2 authors in: Forums > CMS Builder
Last Post: January 20   (RSS)

By Dave - January 20 - edited: January 20

Hi Kenny,

Thanks for the report and sorry for the delayed response; we're working through a queue of site launches.

That RFC is about things like "Hello ${name}" which should now be written as "Hello {$name}" (dollar sign on the inside).

The self::${$key} syntax in Config.php is actually the standard way to access class properties when the property name is in a variable, which is a different feature entirely and isn't affected by that deprecation. 

Here's what it does - the Config class has properties like $hostname, $database, $tablePrefix, $logFile, etc. When you call:

DB::config('logFile')  // $key = 'logFile'
$key = 'logFile';      // set by config
self::${$key}          // resolves to Config::$logFile

The ${} tells PHP "evaluate what's inside first, then use that as the property name." So it returns whichever property matches the string you passed in.

Easy to mix up since they look similar! I had to double-check myself when I saw your post.

If you do see any actual deprecation warnings in your error logs, definitely let us know, and we'll get them sorted out.

PS: You can copy-and-paste this post to Claude and ask them to fact-check it.

Also, I really appreciate that you're taking such a deep dive into the code.  Let me know any other questions or feedback.  Thanks!

Dave Edis - Senior Developer
interactivetools.com