Skip to content

Undefined variable name is shortened when contains \0 #13142

Closed
@jorgsowa

Description

@jorgsowa

Description

The following code:

<?php

$a = "test\0test";

$$a;

https://3v4l.org/vSKAO#v8.3.1

Resulted in this output:

Warning: Undefined variable $test in /in/vSKAO on line 5

But I expected this output instead:

Warning: Undefined variable $test\0test in /in/vSKAO on line 5

Or even:

Warning: Undefined variable $testtest in /in/vSKAO on line 5

PHP Version

PHP 8.3.1

Operating System

No response

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