Skip to content

Using ${var} in strings is deprecated, use {$var} #2465

Closed
@nickstrlnkv

Description

@nickstrlnkv

The example here is incorrect. Chapter "Simple syntax" When you use it, it gives an error

<?php $juice = "apple"; // Valid. Explicitly specify the end of the variable name by enclosing it in braces: echo "He drank some juice made of ${juice}s."; ?>
Without error should write:
<?php $juice = "apple"; // Valid. Explicitly specify the end of the variable name by enclosing it in braces: echo "He drank some juice made of {$juice}s."; ?>

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