Two Questions / Variable Variables for Static Properties, Variables From Included Files

Hello Zephir Folks,

I'm just getting started with Zephir, and I'm using it to re-write some functionality in my company's portal framework. I'm looking to see what kind of performance increases we might be able to get from porting PHP to Zephir.

Right now I'm trying to keep the structure of the code as similar as possible between the PHP version and the Zephir version, but there's two things I can't quite seem to figure out.

  • Static Class Properties via Variable Variables

Part of our code uses variable variables to reference static properties, like so:

<?php
$someVar = 'someValue';
// Set self::$someValue to 'foo'
self::$$someVar = 'foo';

I didn't see a way to do this using Zephir without having to do some voodoo with the Reflection class. The list of properties being accessed like this is a known set, so I'll be rewriting this portion eventually (I imagine variable variables aren't friendly for optimization), but I'd like to keep the Zephir and the PHP as close as possible for the first round of tests.

  • Accessing Variables From Included Files

Our current framework stores configuration values in arrays, which are stored in files based on the environment / system / etc. They're pretty simple and look like this:

<?php
$config = array(
  'key' => 'value',
  'key2' => 'value2'
);

I'm able to include these files with Zephir, but I can't quite seem to figure out how to easily access the $config value once the file is included. I can make a call to getdefinedvars() and fetch the value that way, but it doesn't seem very elegent. Is there a better way to do this?

Many thanks for any help you can provide.

Zephir does not support update a static property using a variable as parameter yet

Thank you for the confirmation on the variable static properties.

What about accessing values included from files? Making a call to get-defined-properties() does the trick, but it doens't feel very elegent. If that's the solution then that's what I'll go with, though.

Thank you very much for any help. ♥

Additionally, I'm trying to refer to some objects and classes that exist elsewhere, as PHP. Some of the calls are static. I'm able to refer to them when creating a new object, but unable to do so when calling a static method:

// This is okay, the PHP autoloader kicks in and away we go.
let foo = new \Some_Class_Somewhere();

// Zephir\CompilerException: Class name: Some_Class_Somewhere does not exist
let foo = \Some_Class_Somewhere::foo();

I can work around this using the call_user_func series of functions, but was wondering if this is currently unsupported or if I'm just approaching it incorrectly.

Thanks! ♥