Skip to content

Config child class E_NOTICE on non existent element access #1315

Closed
@viktoras25

Description

@viktoras25

So I was using Phalcon\Config class for following expressions:

if (!empty($config->some->value)) {
    die("Value does not exist");
}

And this works without any problems, which is nice. However when I try to do the same with an inherited class - I get notices "Undefined offset".

This code simulates the issue.

class C extends Phalcon\Config {}

$c1 = new Phalcon\Config();
$c2 = new C();

empty($c1->non->existing->value);
empty($c2->non->existing->value);

Notice is shown only for 2nd empty call. I'm not sure if it's a bug or restriction.

Phalcon version 1.3.0 built from ext.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions