Skip to content

Octal strings are incorrectly converted to integers #11

Open
@ocean90

Description

This is about values like 0755 or 0664 which are used for file permissions. When using DIR_PERM=0755 then env() will convert this to int(755) but the correct value should have been int(493).

php > var_dump( ctype_digit( '0755' ) );
bool(true)
php > var_dump( (int) '0755' );
int(755)
php > var_dump( (int) 0755 );
int(493)

To support this a self::CONVERT_OCTAL option is probably needed which can be used to run before the current integer conversion. https://www.php.net/manual/de/function.octdec.php#85170 might be helpful.

Thoughts?

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