Skip to content

PHP heredocs with double quotes stop doxygen #11107

@max1josef

Description

@max1josef

Describe the bug
PHP heredocs in the form $msg = <<<"EOD" (i.e. with double quotes) will stop doxygen from processing the remainder of the source file.

To Reproduce

<?php

/**
 * function with "heredoc"
 */

function hello()
{
    $msg = <<<"EOD"
Hello, World!
EOD;
    print($msg);
}

/**
 * this function is not documented by doxygen
 */

function foo()
{
    print("foo");
}

hello();
foo();

Expected behavior
Both functions should appear in the resulting documentation, but function foo() is omitted.
If you write:

  • $msg = <<<EOD // herdoc without double quotes
    or
  • $msg = <<<'EOD' // nowdoc

doxygen works as expected.

Version

C:\>doxygen --version
1.12.0 (c73f5d30f9e8b1df5ba15a1d064ff2067cbb8267)

Platform is Windows 10, 64bit, 22H2, Build 19045.4780

Additional context
Not a big deal, since $msg = <<<EOD and $msg = <<<"EOD" are equivalent (i.e. the double quotes are optional). But I prefer the syntax with double quotes, to explicitely distingiush heredocs from nowdocs (with single quotes).

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions