Skip to content

ParseError in PHP 8.4.0RC4 #16956

@ljfreelancer88

Description

@ljfreelancer88

Description

The following code:

// This is not working because there's no space for hash sign. This is working before.
class SignupForm extends Model
{
    public function rules()
    {
        return [
            #['username', 'string', 'min' => 7, 'max' => 12],
        ];
    }

// This is working if i put space for hash sign.
class SignupForm extends Model
{
    public function rules()
    {
        return [
            # ['username', 'string', 'min' => 7, 'max' => 12], 
        ];
    }

Resulted in this output:

ParseError: syntax error, unexpected token "["

PHP Version

PHP 8.4.0RC4

Operating System

Ubuntu 20

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions