%PDF- %GIF98; %PNG; .
Cyber Programmer
Logo of a company Server : Apache
System : Linux host.digitalbabaji.in 4.18.0-513.11.1.el8_9.x86_64 #1 SMP Wed Jan 17 02:00:40 EST 2024 x86_64
User : addictionfreeind ( 1003)
PHP Version : 7.2.34
Disable Function : exec,passthru,shell_exec,system
Directory :  /home/addictionfreeind/www/vendor/nikic/php-parser/test/code/parser/stmt/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/addictionfreeind/www/vendor/nikic/php-parser/test/code/parser/stmt/switch.test
Switch
-----
<?php

switch ($a) {
    case 0:
        break;
    // Comment
    case 1;
    default:
}

// alternative syntax
switch ($a):
endswitch;

// leading semicolon
switch ($a) { ; }
switch ($a): ; endswitch;
-----
array(
    0: Stmt_Switch(
        cond: Expr_Variable(
            name: a
        )
        cases: array(
            0: Stmt_Case(
                cond: Scalar_LNumber(
                    value: 0
                )
                stmts: array(
                    0: Stmt_Break(
                        num: null
                    )
                )
            )
            1: Stmt_Case(
                cond: Scalar_LNumber(
                    value: 1
                )
                stmts: array(
                )
                comments: array(
                    0: // Comment
                )
            )
            2: Stmt_Case(
                cond: null
                stmts: array(
                )
            )
        )
    )
    1: Stmt_Switch(
        cond: Expr_Variable(
            name: a
        )
        cases: array(
        )
        comments: array(
            0: // alternative syntax
        )
    )
    2: Stmt_Switch(
        cond: Expr_Variable(
            name: a
        )
        cases: array(
        )
        comments: array(
            0: // leading semicolon
        )
    )
    3: Stmt_Switch(
        cond: Expr_Variable(
            name: a
        )
        cases: array(
        )
    )
)

VaKeR 2022