Evaluation
What will be displayed after you execute the following: echo 'hello $world';
Hello $world
It depends on the value of $world
It will not work due to a syntax error
Hello world
$var = "5"."6"; What is the value of $var ?
5
6
11
56
How do you return a value within a function?
Result=$var;
Return=$var;
Result $var;
Return $var;
What is the correct syntax for specifying a default argument value in a function?
Function my_function(null $param1)
Function my_function($param1 null)
Function my_function($param1=null)
Function my_function($param1==null)
What is the difference between include and require?
"Require" supports the inclusion of folders, while "include" does not allow it
"Include" includes only one file, while "require" can include filenames with wildcards
There is no difference, "require" is just an alias for "include"
"require" stops the script execution if the file does not exist, while "include" only gives out a warning
Which of the following best describes the mechanism of serialization?
Serialization allows almost all types of variables to be stored as string, even arrays and objects
Serialization is an easy mechanism allowing developers to generate serial numbers within the code
Serialization allows developers to use the serial and USB ports of the server
Serialization creates multiple chains of objects based on integer values
Why is the following instruction unsafe? require($_GET["file"].".php");
There will be a fatal error if the specified file does not exist
There will be a fatal error if the "file" value is undefined in the $_GET array
An attacker could upload an external PHP file using this instruction
An attacker could exploit your site by including files that are not in the document root
Which of the following best describes $_REQUEST?
An array that contains the contents of $_POST, $_GET, and $_COOKIE
An array that contains the contents of $_COOKIE and $_SERVER
An array that contains the contents of $_POST and $_GET
An array that contains the contents of $_POST, $_GET, $_COOKIE, and $_SERVER
What is the difference between file_get_contents($file) and @file_get_contents($file) ?
There is no difference at all
The first one performs a buffered read, while the second one reads the whole file at once
The first one may display a warning message if the file does not exist, while the second won't
The first one works while the second one has a syntax error
If you were to create a class Student, inheriting the class Person, which of the following syntaxes would you use?
class Student {
inherit Person;
}
inherit Person;
}
class Student inherit Person {
}
}
class Student extends Person {
}
}
class Student: Person {
}
}
How do you call a static method?
MyClass::my_function();
$obj->my_function();
MyClass->my_function();
Static my_function();
Considering the following code, what will be displayed?
fun ction my_fun ction($param1) {
echo $param1.": ".implode(" ", func_get_args());
}
my_fun ction("Test", "error", 583);
A standard PHP warning message
A standard PHP error message
Test: Test error 583
Test: error 583
How is the OOP concept of multiple inheritance implemented in PHP?
class Child1 extends Parent1, Parent2, Parent3 {
}
class Child1 extends Parent1 {
extends Parent2;
extends Parent3;
}
class Child1 extends Parent1 {
extends Parent2, Parent3;
}
The other 3 answers are all invalid
What is Drush?
It is a Drupal core module
It is a Drupal contrib module
It is a command line shell and Unix scripting interface for Drupal
It is a program to manage Drupal sites
In Drupal 7 where can I find information about database connection?
In sites/default/settings.php file
In includes/database/database.inc file
In sites/default/files/settings.php file
In includes/common.inc file
In Drupal 7 what is needed to define a custom module?
.info file
.module file
.install file
.info and .module files
What is .tpl file in Drupal 7?
It is a temporary file
It is a template file
It is an include file
It is a core file
What can we do by implementing hooks in Drupal?
Interact with Drupal core
Interact with modules
Alter values
All answers are correct
How we can execute a function from enabled module in Drupal 7?
First we need to include .module file and then execute its function
Simply execute needed function
Need to write custom module and in it execute function
Function can't be executed
In Drupal 7 how we can get node id from database?
Execute db_select()
Execute db_query()
Execute EntityFieldQuery()
All options are correct
In Drupal how can you provide list of latest articles in RSS format?
Create a view with a Feed display filtering only the Articles content type.
Create a view with a Page display filtering only the Articles content type and under filter options enable the RSS filter
Create a view with a Page display filtering only the Articles content type and under Style output options select RSS Feed instead of Unformatted List
Create a view with a Page display filtering only the Articles content type, modifying the .tpl.php file for the view and render the output in RSS format
In Drupal 7 what is correct way to create a custom database table?
Create custom module and in .install file implement hook_schema()
Create custom module and in .install file implement hook_install()
Create custom module and in .module file implement hook_init()
Create custom module and in .module file implement hook_schema()
Lets say we need to store client records in database and the most common action will be searching by name. Which database table schema will fit best?
$schema['client'] = array(
'fields' => array(
'id' => array(
'type' => 'serial',
'unsigned' => TRUE,
'not null' => TRUE,
),
'firstname' => array(
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
),
'lastname' => array(
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
),
'email' => array(
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
),
),
'indexes' => array(
'name' => array('firstname', 'lastname'),
),
'unique keys' => array(
'email' => array('email'),
),
'primary key' => array('id'),
);
$schema['client'] = array(
'fields' => array(
'id' => array(
'type' => 'serial',
'unsigned' => TRUE,
'not null' => TRUE,
),
'name' => array(
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
),
'email' => array(
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
),
),
'primary key' => array('id'),
);
$schema['client'] = array(
'fields' => array(
'id' => array(
'type' => 'int',
'not null' => TRUE,
'default' => 0,
),
'name' => array(
'type' => 'text',
'not null' => FALSE,
),
'email' => array(
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
),
),
'unique keys' => array(
'email' => array('email'),
),
'primary key' => array('id'),
);
$schema['client'] = array(
'fields' => array(
'id' => array(
'type' => 'serial',
'unsigned' => TRUE,
'not null' => TRUE,
),
'firstname' => array(
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
),
'lastname' => array(
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
),
'email' => array(
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
),
),
'unique keys' => array(
'email' => array('email'),
),
'primary key' => array('id'),
);
{"name":"Evaluation", "url":"https://www.quiz-maker.com/QPREVIEW","txt":"What is the correct syntax for specifying a default argument value in a function?, How do you return a value within a function?, What will be displayed after you execute the following: echo 'hello $world';","img":"https://www.quiz-maker.com/3012/images/ogquiz.png"}
More Quizzes
FRIDAY OR SATURDAY, AMOUNT OF GIRLS (DAYTIME, UNTIL 7PM)
100
نفسنة
100
کدام ترک باهوش است؟
100
System path exam 1
740
Part 36
65320
Part 45(1-125)
125620
Which Much Ado About Nothing Character Are You?
105134
Which Total Drama Character Are You?
1050
Are we friends
251212
Puerto Rico Video Quiz: https://www.youtube.com/watch?v=5mHoislgzzQ
15815
What's Your IoT IQ?
1050
De grote KISP fietstechniek quiz
100