1. Question: You work as a Web Developer for Remote Inc. What will be the output when you try to run the script below?
    <?php
        $b = false;
        if($b = true)
          print("true");
        else
          print("false");
    ?>

    A
    false

    B
    true

    C
    The script will throw an error message.

    D
    true false

    Note: Not available
    1. Report
  2. Question: Which of the following options is/are correct regarding variable scopes in PHP?

    A
    script, function and class

    B
    class, global and script

    C
    global, function and class

    D
    global, script and function

    Note: Explanation: Global, function and class scope are the three variable scopes for PHP. Variable scope describes where in a program's text the variable may be used, while the extent (or lifetime) describes when in a program's execution a variable has a value. PHP has three types of variable scopes: 1. Function Scope: Variable scope exists within the function where the variable was defined. 2. Global Scope: Variable scope exists everywhere in the PHP script. 3. Class Scope: Variable scope exists within a class where the variable was defined.
    1. Report
Copyright © 2024. Powered by Intellect Software Ltd