✔ Abstract Syntax Tree!!


<?php
echo substr("abc", [1,2]);

% phan -a test.php
AST_STMT_LIST @ 1
    0: AST_STMT_LIST @ 2
        0: AST_ECHO @ 2
            0: AST_CALL @ 2
                0: AST_NAME @ 2
                    flags: NAME_NOT_FQ (1)
                    0: "substr"
                1: AST_ARG_LIST @ 2
                    0: "abc"
                    1: AST_ARRAY @ 2
                        0: AST_ARRAY_ELEM @ 2
                            flags: 0
                            0: 1
                            1: null
                        1: AST_ARRAY_ELEM @ 2
                            flags: 0
                            0: 2
                            1: null

% phan test.php
test.php:2 TypeError arg#2(start) is int[] but substr() takes int