uniter icon indicating copy to clipboard operation
uniter copied to clipboard

include_once: Not resolved

Open IngwiePhoenix opened this issue 9 years ago • 0 comments

include_once is resolved as a regular function.

[email protected] /tmp $ nano test.php
[email protected] /tmp $ cat test.php
<?php
include_once "foo.php";
[email protected] /tmp $ uniter2ast test.php 

/Users/Ingwie/Work/uniter/uniter-tools/node_modules/phptoast/src/ErrorHandler.js:43
        throw error;
        ^
Error: PHP Parse error: syntax error, unexpected '"' in (program) on line 2
[email protected] /tmp $ nano test.php
[email protected] /tmp $ cat test.php
<?php
# Changed to "normal" function call:
include_once("foo.php");
[email protected] /tmp $ uniter2ast test.php 
{
    "statements": [
        {
            "expression": {
                "func": {
                    "string": "include_once",
                    "name": "N_STRING"
                },
                "args": [
                    {
                        "string": "foo.php",
                        "name": "N_STRING_LITERAL"
                    }
                ],
                "name": "N_FUNCTION_CALL"
            },
            "name": "N_EXPRESSION_STATEMENT"
        }
    ],
    "name": "N_PROGRAM"
}

This should explain itself. :)

IngwiePhoenix avatar Dec 26 '15 23:12 IngwiePhoenix