The workshop is designed to help you anticipate possible questions, review what you've learned, and begin putting your knowledge into practice.
Which of the following variable names is not valid?
$a_value_submitted_by_a_user $666666xyz $xyz666666 $___counter___ $the first $file-name
The variable name $666666xyz is not valid because it does not begin with a letter or an underscore character. The variable name $the first is not valid because it contains a space. $file-name is also invalid because it contains a nonalphanumeric character.
What will the following code fragment output?
$num = 33; (boolean) $num; print $num;
The fragment will print the integer 33. The cast to Boolean produces a converted copy of the value stored in $num. It does not alter the value actually stored there.
What will the following statement output?
The statement will output the string "string".
What will be the output from the following code fragment?