Skip to content

NOWDOC test expects HEREDOC and NOWDOC is not working locally but passes on CI #36

@Ben3eeE

Description

@Ben3eeE

==========
Nowdocs
==========
<?php
<<<'PHP'
<?php echo phpversion().PHP_SAPI;
PHP
?>
---
(program (expression_statement (heredoc)))

This test fails locally:

    ✗ Nowdocs
        »
        actual expected

        (program (ERROR) (text) (echo_statement (binary_expression (function_call_expression (qualified_name (name)) (arguments)) (qualified_name (name)))) (expression_statement (qualified_name (name))))heredoc)))

I don't know why it doesn't fail on CI but does locally. It seems that NOWDOC is expected to parsed as HEREDOC from the test however which is wrong.

Also testing the tests code in Atom when running atom/language-php#303 confirms that it's parsed the same way as the test.

Expected should be:

(program (expression_statement (nowdoc)))

http://php.net/manual/en/language.types.string.php#language.types.string.syntax.heredoc
http://php.net/manual/en/language.types.string.php#language.types.string.syntax.nowdoc
https://wiki.php.net/rfc/heredoc-with-double-quotes

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions