[
    FullOpeningTag(
        Span(
            1,
            1,
        ),
    ),
    Declare(
        Declare {
            span: Span(
                11,
                1,
            ),
            entries: DeclareEntryGroup {
                start: Span(
                    11,
                    8,
                ),
                end: Span(
                    11,
                    23,
                ),
                entries: [
                    DeclareEntry {
                        key: SimpleIdentifier {
                            span: Span(
                                11,
                                9,
                            ),
                            value: "strict_types",
                        },
                        span: Span(
                            11,
                            21,
                        ),
                        value: Integer(
                            LiteralInteger {
                                value: "1",
                                span: Span(
                                    11,
                                    22,
                                ),
                            },
                        ),
                    },
                ],
            },
            body: Noop {
                span: Span(
                    11,
                    24,
                ),
            },
        },
    ),
    Namespace(
        Unbraced(
            UnbracedNamespace {
                start: Span(
                    13,
                    1,
                ),
                name: SimpleIdentifier {
                    span: Span(
                        13,
                        11,
                    ),
                    value: "Psl\Internal",
                },
                end: Span(
                    13,
                    23,
                ),
                statements: [
                    Use {
                        uses: [
                            Use {
                                name: SimpleIdentifier {
                                    span: Span(
                                        15,
                                        5,
                                    ),
                                    value: "Closure",
                                },
                                alias: None,
                                kind: None,
                            },
                        ],
                        kind: Normal,
                    },
                    Use {
                        uses: [
                            Use {
                                name: SimpleIdentifier {
                                    span: Span(
                                        16,
                                        5,
                                    ),
                                    value: "Psl\Str",
                                },
                                alias: None,
                                kind: None,
                            },
                        ],
                        kind: Normal,
                    },
                    Use {
                        uses: [
                            Use {
                                name: SimpleIdentifier {
                                    span: Span(
                                        18,
                                        14,
                                    ),
                                    value: "restore_error_handler",
                                },
                                alias: None,
                                kind: None,
                            },
                        ],
                        kind: Function,
                    },
                    Use {
                        uses: [
                            Use {
                                name: SimpleIdentifier {
                                    span: Span(
                                        19,
                                        14,
                                    ),
                                    value: "set_error_handler",
                                },
                                alias: None,
                                kind: None,
                            },
                        ],
                        kind: Function,
                    },
                    Function(
                        Function {
                            comments: CommentGroup {
                                comments: [
                                    Comment {
                                        span: Span(
                                            3,
                                            1,
                                        ),
                                        format: SingleLine,
                                        content: "// The following code was taken from of PSL.",
                                    },
                                    Comment {
                                        span: Span(
                                            4,
                                            1,
                                        ),
                                        format: SingleLine,
                                        content: "//",
                                    },
                                    Comment {
                                        span: Span(
                                            5,
                                            1,
                                        ),
                                        format: SingleLine,
                                        content: "// https://github.com/azjezz/psl/blob/657ce9888be47cee49418989420b83661f7cf1c4/src/Psl/Internal/box.php",
                                    },
                                    Comment {
                                        span: Span(
                                            6,
                                            1,
                                        ),
                                        format: SingleLine,
                                        content: "//",
                                    },
                                    Comment {
                                        span: Span(
                                            7,
                                            1,
                                        ),
                                        format: SingleLine,
                                        content: "// Code subject to the MIT license (https://github.com/azjezz/psl/blob/657ce9888be47cee49418989420b83661f7cf1c4/LICENSE).",
                                    },
                                    Comment {
                                        span: Span(
                                            8,
                                            1,
                                        ),
                                        format: SingleLine,
                                        content: "//",
                                    },
                                    Comment {
                                        span: Span(
                                            9,
                                            1,
                                        ),
                                        format: SingleLine,
                                        content: "// Copyright (c) 2019-2022 Saif Eddin Gmati <azjezz@protonmail.com>",
                                    },
                                    Comment {
                                        span: Span(
                                            21,
                                            1,
                                        ),
                                        format: Document,
                                        content: "/**\n * @template T\n *\n * @param (Closure(): T) $fun\n *\n * @return array{0: T, 1: ?string}\n *\n * @internal\n *\n * @psalm-suppress MissingThrowsDocblock\n */",
                                    },
                                ],
                            },
                            attributes: [],
                            function: Span(
                                32,
                                1,
                            ),
                            ampersand: None,
                            name: SimpleIdentifier {
                                span: Span(
                                    32,
                                    10,
                                ),
                                value: "box",
                            },
                            parameters: FunctionParameterList {
                                comments: CommentGroup {
                                    comments: [],
                                },
                                left_parenthesis: Span(
                                    32,
                                    13,
                                ),
                                parameters: CommaSeparated {
                                    inner: [
                                        FunctionParameter {
                                            comments: CommentGroup {
                                                comments: [],
                                            },
                                            name: SimpleVariable {
                                                span: Span(
                                                    32,
                                                    22,
                                                ),
                                                name: "fun",
                                            },
                                            attributes: [],
                                            data_type: Some(
                                                Named(
                                                    Span(
                                                        32,
                                                        14,
                                                    ),
                                                    "Closure",
                                                ),
                                            ),
                                            ellipsis: None,
                                            default: None,
                                            ampersand: None,
                                        },
                                    ],
                                    commas: [],
                                },
                                right_parenthesis: Span(
                                    32,
                                    26,
                                ),
                            },
                            return_type: Some(
                                ReturnType {
                                    colon: Span(
                                        32,
                                        27,
                                    ),
                                    data_type: Array(
                                        Span(
                                            32,
                                            29,
                                        ),
                                    ),
                                },
                            ),
                            body: FunctionBody {
                                comments: CommentGroup {
                                    comments: [],
                                },
                                left_brace: Span(
                                    33,
                                    1,
                                ),
                                statements: [
                                    Expression {
                                        expression: AssignmentOperation(
                                            Assign {
                                                left: Variable(
                                                    SimpleVariable(
                                                        SimpleVariable {
                                                            span: Span(
                                                                34,
                                                                5,
                                                            ),
                                                            name: "last_message",
                                                        },
                                                    ),
                                                ),
                                                equals: Span(
                                                    34,
                                                    19,
                                                ),
                                                right: Null,
                                            },
                                        ),
                                        ending: Semicolon(
                                            Span(
                                                34,
                                                25,
                                            ),
                                        ),
                                    },
                                    Expression {
                                        expression: FunctionCall {
                                            target: Identifier(
                                                SimpleIdentifier(
                                                    SimpleIdentifier {
                                                        span: Span(
                                                            36,
                                                            5,
                                                        ),
                                                        value: "set_error_handler",
                                                    },
                                                ),
                                            ),
                                            arguments: ArgumentList {
                                                comments: CommentGroup {
                                                    comments: [
                                                        Comment {
                                                            span: Span(
                                                                35,
                                                                5,
                                                            ),
                                                            format: Document,
                                                            content: "/** @psalm-suppress InvalidArgument */",
                                                        },
                                                    ],
                                                },
                                                left_parenthesis: Span(
                                                    36,
                                                    22,
                                                ),
                                                arguments: [
                                                    Positional {
                                                        comments: CommentGroup {
                                                            comments: [],
                                                        },
                                                        ellipsis: None,
                                                        value: Closure(
                                                            Closure {
                                                                comments: CommentGroup {
                                                                    comments: [],
                                                                },
                                                                attributes: [],
                                                                static: Some(
                                                                    Span(
                                                                        36,
                                                                        23,
                                                                    ),
                                                                ),
                                                                function: Span(
                                                                    36,
                                                                    30,
                                                                ),
                                                                ampersand: None,
                                                                parameters: FunctionParameterList {
                                                                    comments: CommentGroup {
                                                                        comments: [],
                                                                    },
                                                                    left_parenthesis: Span(
                                                                        36,
                                                                        39,
                                                                    ),
                                                                    parameters: CommaSeparated {
                                                                        inner: [
                                                                            FunctionParameter {
                                                                                comments: CommentGroup {
                                                                                    comments: [],
                                                                                },
                                                                                name: SimpleVariable {
                                                                                    span: Span(
                                                                                        36,
                                                                                        44,
                                                                                    ),
                                                                                    name: "_type",
                                                                                },
                                                                                attributes: [],
                                                                                data_type: Some(
                                                                                    Integer(
                                                                                        Span(
                                                                                            36,
                                                                                            40,
                                                                                        ),
                                                                                    ),
                                                                                ),
                                                                                ellipsis: None,
                                                                                default: None,
                                                                                ampersand: None,
                                                                            },
                                                                            FunctionParameter {
                                                                                comments: CommentGroup {
                                                                                    comments: [],
                                                                                },
                                                                                name: SimpleVariable {
                                                                                    span: Span(
                                                                                        36,
                                                                                        59,
                                                                                    ),
                                                                                    name: "message",
                                                                                },
                                                                                attributes: [],
                                                                                data_type: Some(
                                                                                    String(
                                                                                        Span(
                                                                                            36,
                                                                                            52,
                                                                                        ),
                                                                                    ),
                                                                                ),
                                                                                ellipsis: None,
                                                                                default: None,
                                                                                ampersand: None,
                                                                            },
                                                                        ],
                                                                        commas: [
                                                                            Span(
                                                                                36,
                                                                                50,
                                                                            ),
                                                                        ],
                                                                    },
                                                                    right_parenthesis: Span(
                                                                        36,
                                                                        67,
                                                                    ),
                                                                },
                                                                uses: Some(
                                                                    ClosureUse {
                                                                        comments: CommentGroup {
                                                                            comments: [],
                                                                        },
                                                                        use: Span(
                                                                            36,
                                                                            69,
                                                                        ),
                                                                        left_parenthesis: Span(
                                                                            36,
                                                                            73,
                                                                        ),
                                                                        variables: CommaSeparated {
                                                                            inner: [
                                                                                ClosureUseVariable {
                                                                                    comments: CommentGroup {
                                                                                        comments: [],
                                                                                    },
                                                                                    ampersand: Some(
                                                                                        Span(
                                                                                            36,
                                                                                            74,
                                                                                        ),
                                                                                    ),
                                                                                    variable: SimpleVariable {
                                                                                        span: Span(
                                                                                            36,
                                                                                            75,
                                                                                        ),
                                                                                        name: "last_message",
                                                                                    },
                                                                                },
                                                                            ],
                                                                            commas: [],
                                                                        },
                                                                        right_parenthesis: Span(
                                                                            36,
                                                                            88,
                                                                        ),
                                                                    },
                                                                ),
                                                                return_type: None,
                                                                body: FunctionBody {
                                                                    comments: CommentGroup {
                                                                        comments: [],
                                                                    },
                                                                    left_brace: Span(
                                                                        36,
                                                                        90,
                                                                    ),
                                                                    statements: [
                                                                        Expression {
                                                                            expression: AssignmentOperation(
                                                                                Assign {
                                                                                    left: Variable(
                                                                                        SimpleVariable(
                                                                                            SimpleVariable {
                                                                                                span: Span(
                                                                                                    37,
                                                                                                    9,
                                                                                                ),
                                                                                                name: "last_message",
                                                                                            },
                                                                                        ),
                                                                                    ),
                                                                                    equals: Span(
                                                                                        37,
                                                                                        23,
                                                                                    ),
                                                                                    right: Variable(
                                                                                        SimpleVariable(
                                                                                            SimpleVariable {
                                                                                                span: Span(
                                                                                                    37,
                                                                                                    25,
                                                                                                ),
                                                                                                name: "message",
                                                                                            },
                                                                                        ),
                                                                                    ),
                                                                                },
                                                                            ),
                                                                            ending: Semicolon(
                                                                                Span(
                                                                                    37,
                                                                                    33,
                                                                                ),
                                                                            ),
                                                                        },
                                                                    ],
                                                                    right_brace: Span(
                                                                        38,
                                                                        5,
                                                                    ),
                                                                },
                                                            },
                                                        ),
                                                    },
                                                ],
                                                right_parenthesis: Span(
                                                    38,
                                                    6,
                                                ),
                                            },
                                        },
                                        ending: Semicolon(
                                            Span(
                                                38,
                                                7,
                                            ),
                                        ),
                                    },
                                    If(
                                        IfStatement {
                                            if: Span(
                                                43,
                                                5,
                                            ),
                                            condition: Parenthesized {
                                                left_parenthesis: Span(
                                                    43,
                                                    8,
                                                ),
                                                inner: LogicalOperation(
                                                    And {
                                                        left: ComparisonOperation(
                                                            NotIdentical {
                                                                left: Null,
                                                                bang_double_equals: Span(
                                                                    43,
                                                                    14,
                                                                ),
                                                                right: Variable(
                                                                    SimpleVariable(
                                                                        SimpleVariable {
                                                                            span: Span(
                                                                                43,
                                                                                18,
                                                                            ),
                                                                            name: "last_message",
                                                                        },
                                                                    ),
                                                                ),
                                                            },
                                                        ),
                                                        double_ampersand: Span(
                                                            43,
                                                            32,
                                                        ),
                                                        right: FunctionCall {
                                                            target: Identifier(
                                                                SimpleIdentifier(
                                                                    SimpleIdentifier {
                                                                        span: Span(
                                                                            43,
                                                                            35,
                                                                        ),
                                                                        value: "Str\contains",
                                                                    },
                                                                ),
                                                            ),
                                                            arguments: ArgumentList {
                                                                comments: CommentGroup {
                                                                    comments: [
                                                                        Comment {
                                                                            span: Span(
                                                                                40,
                                                                                5,
                                                                            ),
                                                                            format: Document,
                                                                            content: "/**\n     * @var string|null $last_message\n     */",
                                                                        },
                                                                    ],
                                                                },
                                                                left_parenthesis: Span(
                                                                    43,
                                                                    47,
                                                                ),
                                                                arguments: [
                                                                    Positional {
                                                                        comments: CommentGroup {
                                                                            comments: [],
                                                                        },
                                                                        ellipsis: None,
                                                                        value: Variable(
                                                                            SimpleVariable(
                                                                                SimpleVariable {
                                                                                    span: Span(
                                                                                        43,
                                                                                        48,
                                                                                    ),
                                                                                    name: "last_message",
                                                                                },
                                                                            ),
                                                                        ),
                                                                    },
                                                                    Positional {
                                                                        comments: CommentGroup {
                                                                            comments: [],
                                                                        },
                                                                        ellipsis: None,
                                                                        value: Literal(
                                                                            String(
                                                                                LiteralString {
                                                                                    value: "): ",
                                                                                    span: Span(
                                                                                        43,
                                                                                        63,
                                                                                    ),
                                                                                },
                                                                            ),
                                                                        ),
                                                                    },
                                                                ],
                                                                right_parenthesis: Span(
                                                                    43,
                                                                    68,
                                                                ),
                                                            },
                                                        },
                                                    },
                                                ),
                                                right_parenthesis: Span(
                                                    43,
                                                    69,
                                                ),
                                            },
                                            body: Statement {
                                                statement: Block(
                                                    Braced {
                                                        left_brace: Span(
                                                            43,
                                                            71,
                                                        ),
                                                        inner: [
                                                            Expression {
                                                                expression: AssignmentOperation(
                                                                    Assign {
                                                                        left: Variable(
                                                                            SimpleVariable(
                                                                                SimpleVariable {
                                                                                    span: Span(
                                                                                        44,
                                                                                        9,
                                                                                    ),
                                                                                    name: "last_message",
                                                                                },
                                                                            ),
                                                                        ),
                                                                        equals: Span(
                                                                            44,
                                                                            23,
                                                                        ),
                                                                        right: FunctionCall {
                                                                            target: Identifier(
                                                                                SimpleIdentifier(
                                                                                    SimpleIdentifier {
                                                                                        span: Span(
                                                                                            44,
                                                                                            25,
                                                                                        ),
                                                                                        value: "Str\after",
                                                                                    },
                                                                                ),
                                                                            ),
                                                                            arguments: ArgumentList {
                                                                                comments: CommentGroup {
                                                                                    comments: [],
                                                                                },
                                                                                left_parenthesis: Span(
                                                                                    44,
                                                                                    34,
                                                                                ),
                                                                                arguments: [
                                                                                    Positional {
                                                                                        comments: CommentGroup {
                                                                                            comments: [],
                                                                                        },
                                                                                        ellipsis: None,
                                                                                        value: FunctionCall {
                                                                                            target: Identifier(
                                                                                                SimpleIdentifier(
                                                                                                    SimpleIdentifier {
                                                                                                        span: Span(
                                                                                                            45,
                                                                                                            13,
                                                                                                        ),
                                                                                                        value: "Str\lowercase",
                                                                                                    },
                                                                                                ),
                                                                                            ),
                                                                                            arguments: ArgumentList {
                                                                                                comments: CommentGroup {
                                                                                                    comments: [],
                                                                                                },
                                                                                                left_parenthesis: Span(
                                                                                                    45,
                                                                                                    26,
                                                                                                ),
                                                                                                arguments: [
                                                                                                    Positional {
                                                                                                        comments: CommentGroup {
                                                                                                            comments: [],
                                                                                                        },
                                                                                                        ellipsis: None,
                                                                                                        value: Variable(
                                                                                                            SimpleVariable(
                                                                                                                SimpleVariable {
                                                                                                                    span: Span(
                                                                                                                        45,
                                                                                                                        27,
                                                                                                                    ),
                                                                                                                    name: "last_message",
                                                                                                                },
                                                                                                            ),
                                                                                                        ),
                                                                                                    },
                                                                                                ],
                                                                                                right_parenthesis: Span(
                                                                                                    45,
                                                                                                    40,
                                                                                                ),
                                                                                            },
                                                                                        },
                                                                                    },
                                                                                    Positional {
                                                                                        comments: CommentGroup {
                                                                                            comments: [
                                                                                                Comment {
                                                                                                    span: Span(
                                                                                                        46,
                                                                                                        13,
                                                                                                    ),
                                                                                                    format: SingleLine,
                                                                                                    content: "// how i feel toward PHP error handling:",
                                                                                                },
                                                                                            ],
                                                                                        },
                                                                                        ellipsis: None,
                                                                                        value: Literal(
                                                                                            String(
                                                                                                LiteralString {
                                                                                                    value: "): ",
                                                                                                    span: Span(
                                                                                                        47,
                                                                                                        13,
                                                                                                    ),
                                                                                                },
                                                                                            ),
                                                                                        ),
                                                                                    },
                                                                                ],
                                                                                right_parenthesis: Span(
                                                                                    48,
                                                                                    9,
                                                                                ),
                                                                            },
                                                                        },
                                                                    },
                                                                ),
                                                                ending: Semicolon(
                                                                    Span(
                                                                        48,
                                                                        10,
                                                                    ),
                                                                ),
                                                            },
                                                        ],
                                                        right_brace: Span(
                                                            49,
                                                            5,
                                                        ),
                                                    },
                                                ),
                                                elseifs: [],
                                                else: None,
                                            },
                                        },
                                    ),
                                    Try(
                                        TryBlock {
                                            start: Span(
                                                51,
                                                5,
                                            ),
                                            end: Span(
                                                61,
                                                1,
                                            ),
                                            body: [
                                                Expression {
                                                    expression: AssignmentOperation(
                                                        Assign {
                                                            left: Variable(
                                                                SimpleVariable(
                                                                    SimpleVariable {
                                                                        span: Span(
                                                                            52,
                                                                            9,
                                                                        ),
                                                                        name: "value",
                                                                    },
                                                                ),
                                                            ),
                                                            equals: Span(
                                                                52,
                                                                16,
                                                            ),
                                                            right: FunctionCall {
                                                                target: Variable(
                                                                    SimpleVariable(
                                                                        SimpleVariable {
                                                                            span: Span(
                                                                                52,
                                                                                18,
                                                                            ),
                                                                            name: "fun",
                                                                        },
                                                                    ),
                                                                ),
                                                                arguments: ArgumentList {
                                                                    comments: CommentGroup {
                                                                        comments: [],
                                                                    },
                                                                    left_parenthesis: Span(
                                                                        52,
                                                                        22,
                                                                    ),
                                                                    arguments: [],
                                                                    right_parenthesis: Span(
                                                                        52,
                                                                        23,
                                                                    ),
                                                                },
                                                            },
                                                        },
                                                    ),
                                                    ending: Semicolon(
                                                        Span(
                                                            52,
                                                            24,
                                                        ),
                                                    ),
                                                },
                                                Expression {
                                                    expression: AssignmentOperation(
                                                        Assign {
                                                            left: Variable(
                                                                SimpleVariable(
                                                                    SimpleVariable {
                                                                        span: Span(
                                                                            55,
                                                                            9,
                                                                        ),
                                                                        name: "result",
                                                                    },
                                                                ),
                                                            ),
                                                            equals: Span(
                                                                55,
                                                                17,
                                                            ),
                                                            right: ShortArray(
                                                                Bracketed {
                                                                    left_bracket: Span(
                                                                        55,
                                                                        19,
                                                                    ),
                                                                    inner: CommaSeparated {
                                                                        inner: [
                                                                            ArrayItem {
                                                                                key: None,
                                                                                value: Variable(
                                                                                    SimpleVariable(
                                                                                        SimpleVariable {
                                                                                            span: Span(
                                                                                                55,
                                                                                                20,
                                                                                            ),
                                                                                            name: "value",
                                                                                        },
                                                                                    ),
                                                                                ),
                                                                                unpack: false,
                                                                                by_ref: false,
                                                                            },
                                                                            ArrayItem {
                                                                                key: None,
                                                                                value: Variable(
                                                                                    SimpleVariable(
                                                                                        SimpleVariable {
                                                                                            span: Span(
                                                                                                55,
                                                                                                28,
                                                                                            ),
                                                                                            name: "last_message",
                                                                                        },
                                                                                    ),
                                                                                ),
                                                                                unpack: false,
                                                                                by_ref: false,
                                                                            },
                                                                        ],
                                                                        commas: [
                                                                            Span(
                                                                                55,
                                                                                26,
                                                                            ),
                                                                        ],
                                                                    },
                                                                    right_bracket: Span(
                                                                        55,
                                                                        41,
                                                                    ),
                                                                },
                                                            ),
                                                        },
                                                    ),
                                                    ending: Semicolon(
                                                        Span(
                                                            55,
                                                            42,
                                                        ),
                                                    ),
                                                },
                                                Return {
                                                    return: Span(
                                                        57,
                                                        9,
                                                    ),
                                                    value: Some(
                                                        Variable(
                                                            SimpleVariable(
                                                                SimpleVariable {
                                                                    span: Span(
                                                                        57,
                                                                        16,
                                                                    ),
                                                                    name: "result",
                                                                },
                                                            ),
                                                        ),
                                                    ),
                                                    ending: Semicolon(
                                                        Span(
                                                            57,
                                                            23,
                                                        ),
                                                    ),
                                                },
                                            ],
                                            catches: [],
                                            finally: Some(
                                                FinallyBlock {
                                                    start: Span(
                                                        58,
                                                        7,
                                                    ),
                                                    end: Span(
                                                        61,
                                                        1,
                                                    ),
                                                    body: [
                                                        Expression {
                                                            expression: FunctionCall {
                                                                target: Identifier(
                                                                    SimpleIdentifier(
                                                                        SimpleIdentifier {
                                                                            span: Span(
                                                                                59,
                                                                                9,
                                                                            ),
                                                                            value: "restore_error_handler",
                                                                        },
                                                                    ),
                                                                ),
                                                                arguments: ArgumentList {
                                                                    comments: CommentGroup {
                                                                        comments: [
                                                                            Comment {
                                                                                span: Span(
                                                                                    54,
                                                                                    9,
                                                                                ),
                                                                                format: Document,
                                                                                content: "/** @var array{0: T, 1: ?string} $result */",
                                                                            },
                                                                        ],
                                                                    },
                                                                    left_parenthesis: Span(
                                                                        59,
                                                                        30,
                                                                    ),
                                                                    arguments: [],
                                                                    right_parenthesis: Span(
                                                                        59,
                                                                        31,
                                                                    ),
                                                                },
                                                            },
                                                            ending: Semicolon(
                                                                Span(
                                                                    59,
                                                                    32,
                                                                ),
                                                            ),
                                                        },
                                                    ],
                                                },
                                            ),
                                        },
                                    ),
                                ],
                                right_brace: Span(
                                    61,
                                    1,
                                ),
                            },
                        },
                    ),
                ],
            },
        ),
    ),
]
