Andrewsville / PHP-Token-Reflection

Library emulating the PHP internal reflection using just the tokenized source code
http://andrewsville.github.com/PHP-Token-Reflection/
Other
190 stars 44 forks source link

Invalid value definition #69

Open edi9999 opened 9 years ago

edi9999 commented 9 years ago

Hi I get an error Invalid value definition when I use the following code:

<?php
class Hello {
    const EXPECTED_INPUT_NAME = Array();
}

It works fine with normal constant definition.

The real code I'm using is :

/**
 * @var string[]
 */
const EXPECTED_INPUT_NAME = Array(
    "currency"=>self::MANDATORY,
    "date"=>self::MANDATORY,
    "information"=>self::OPTIONAL,
    "mac"=>self::MANDATORY,
    "offerAmount"=>self::MANDATORY,
    "pos"=>self::MANDATORY,
    "reference"=>self::MANDATORY,
    "status"=>self::MANDATORY,
    "transactionAmount"=>self::MANDATORY,
    "version"=>self::MANDATORY,
);

but I found out that it still fails even with void arrays.

edi9999 commented 9 years ago

This is a PHP 5.6 feature, that's maybe the reason why it is not yet implemented