Zephir: What value does a class variable get if it is not assigned a value at declaration?

In this case:

class Blah {

    protected static something;

}

Is the default value of something null?



67.6k

probably, die(var_dump(self::something)); ?



4.0k

I'm seeing lots of if something === null on undefined class variables in Phalcon code.

Trying to debug something. Just wondering



67.6k

can you give me a link to check it and see if i can explain it ( eeventually )



4.0k
edited Apr '17

Sure.

There is some issue with MongoCollection in the Incubator with PHP 7.1. One of the issues is with the reserved words when saving. ref: here and here

In Phalcon\Mvc\Collection, the base class of MongoCollection, _reserved is declared on line 59: protected static _reserved; then tested later:

var reserved;

let reserved = self::_reserved;
if reserved === null {...

Been reading that Zephir tries to do type inference, so maybe _reserved gets [] instead of null.

That said, I am just now looking at Zephir.

Null i think.