Home / CSE / PHP - CS :: Basic PHP

CSE :: PHP - CS

  1. Under what circumstance is it impossible to assign a default value to a parameter while declaring a function?

  2. A.

     When the parameter is Boolean

    B.

     When the function is being declared as a member of a class

    C.

     When the parameter is being declared as passed by reference

    D.

     When the function contains only one parameter

    E.

     Never

    View Answer

    Workspace

    Discuss Discuss in Forum


  3. Variables always start with a ........ in PHP

  4. A.

     Pond-sign

    B.

     Yen-sign

    C.

     Dollar-sign

    D.

     Euro-sign

    View Answer

    Workspace

    Discuss Discuss in Forum


  5. PHP is an open source software.

  6. A.

     True

    B.

     False

    View Answer

    Workspace

    Discuss Discuss in Forum


  7. Which of the following is not valid PHP code?

  8. A.

     $_10

    B.

     ${“MyVar”}

    C.

     &$something

    D.

     $10_somethings

    E.

     $aVaR

    View Answer

    Workspace

    Discuss Discuss in Forum


  9. PHP runs on different platforms (Windows, Linux, Unix, etc.)

  10. A.

     True

    B.

     False

    View Answer

    Workspace

    Discuss Discuss in Forum


  11. You can test the type of any variable with the ..... function.

  12. A.

     whattype()

    B.

     showtype()

    C.

     gettype()

    D.

     settype()

    View Answer

    Workspace

    Discuss Discuss in Forum


  13. Assigning the empty string (like ' ') to a variable automatically renders it empty.

  14. A.

     True

    B.

     False

    View Answer

    Workspace

    Discuss Discuss in Forum


  15. If you echo a Boolean variable, the value FALSE displays as a .... and the value TRUE echoes as a .....

  16. A.

     0, 1

    B.

     blank string, 2

    C.

     empty variable, 1

    D.

     blank string, 1

    View Answer

    Workspace

    Discuss Discuss in Forum


  17. When a simple data type is casted to an array, an array is created with the original value in the first element.

  18. A.

     True

    B.

     False

    View Answer

    Workspace

    Discuss Discuss in Forum


  19. String values must be enclosed in ......

  20. A.

     single quotes

    B.

     double quotes

    C.

     both A and B

    D.

     none of above

    View Answer

    Workspace

    Discuss Discuss in Forum