• Shuffle
    Toggle On
    Toggle Off
  • Alphabetize
    Toggle On
    Toggle Off
  • Front First
    Toggle On
    Toggle Off
  • Both Sides
    Toggle On
    Toggle Off
  • Read
    Toggle On
    Toggle Off
Reading...
Front

Card Range To Study

through

image

Play button

image

Play button

image

Progress

1/10

Click to flip

Use LEFT and RIGHT arrow keys to navigate between flashcards;

Use UP and DOWN arrow keys to flip the card;

H to show hint;

A reads text to speech;

10 Cards in this Set

  • Front
  • Back
What is the main benefit of using a function?
Using functions avoids the need to copy or rewrite similar code sections many times
over by combining sets of statements together so that they can be called by a simple
name.
How many values can a function return?
By default, a function can return a single value. But by utilizing arrays, references,
and global variables, any number of values can be returned.
What is the difference between accessing a variable by name and by reference?
When you reference a variable by name, such as by assigning its value to another
variable or by passing its value to a function, its value is copied. The original does
not change when the copy is changed. But if you reference a variable, only a pointer
(or reference) to its value is used, so that a single value is referenced by more than
one name. Changing the value of the reference will change the original as well.
What is the meaning of scope in PHP?
Scope refers to which parts of a program can access a variable. For example, a
variable of global scope can be accessed by all parts of a PHP program.
How can you incorporate one PHP file within another?
To incorporate one file within another, you can use the include or require directives,
or their safer variants, include_once and require_once.
How is an object different from a function?
A function is a set of statements referenced by a name that can receive and return
values. An object may contain zero, one, or many functions (which are then called
methods) as well as variables (which are called properties), all combined in a single
unit.
How do you create a new object in PHP?
To create a new object in PHP, use the new keyword like this: $object = new Class.
What syntax would you use to create a subclass from an existing one?
To create a subclass, use the extends keyword with syntax such as this: class Sub
class extends Parentclass.
How can you call an initializing piece of code when an object is created?
To call a piece of initializing code when an object is created, create a constructor
method called __construct within the class and place your code there.
Why is it a good idea to explicitly declare properties within a class?
Explicitly declaring properties within a class is unnecessary, as they will be implicitly
declared upon first use. However, it is considered good practice as it helps
with code readability and debugging, and is especially useful to other people who
may have to maintain your code.