Exercises

  1. Which of the following are not valid variables:

    • a) $blah

    • b) $f11

    • c) $_11f

    • d) $11f

    • e) None of the above

  2. What will $foo be set to in this expression: $foo = "wombat" * 2?

  3. What will $bar be set to in this expression: $bar = 5 * 5 + 5?

  4. What does the =< operator do?

  5. How does OR differ from || ?

  6. The superglobal array variables are accessible...

    • a) Only outside functions

    • b) Only inside functions

    • c) Anywhere except in classes

    • d) Anywhere, as long as they are defined GLOBAL

    • e) None of the above

 

Want to learn PHP 7?

Hacking with PHP has been fully updated for PHP 7, and is now available as a downloadable PDF. Get over 1200 pages of hands-on PHP learning today!

If this was helpful, please take a moment to tell others about Hacking with PHP by tweeting about it!

Next chapter: Further reading >>

Previous chapter: Summary

Jump to:

 

Home: Table of Contents

Copyright ©2015 Paul Hudson. Follow me: @twostraws.