Skip to content

Illegal offset type #3

@eapunk

Description

@eapunk

I got 'Illegal offset type' error on fresh installation via composer.
It is not just a notice. Class method analysis failed.
nikic/php-parser v4.0.2 35b8caf75e791ba1b2d24fec1552168d72692b12
php v7.0
Solved by type casting to string

diff --git a/package/src/progpilot/Transformations/Php/Transform.php 
-        $this->context->get_functions()->add_function($myfunction->get_name(), $myfunction);
+        $this->context->get_functions()->add_function((string)$myfunction->get_name(), $myfunction);
-        $myfunction = $this->context->get_functions()->get_function($func->name, $class_name);
+        $myfunction = $this->context->get_functions()->get_function((string)$func->name, $class_name);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions