Welcome to the questionnaire of PHP for Web Developer.
This quiz includes 38 questions on PHP, JS, SQL, CSS. Each question has one or more answers.
Be very attentive.
Be very attentive.
1 PHP
1.1 What abbreviation is responsible for code style guides?
1.1.1 PEAR
1.1.2 PSR
1.1.3 PHP
1.1.4 none of them
1.1.1 PEAR
1.1.2 PSR
1.1.3 PHP
1.1.4 none of them
1.2 Which variables contain arguments from command line when you run PHP script from console?
1.2.1 $arguments
1.2.2 $argv
1.2.3 $_GET
1.2.4 $_SERVER
1.2.5 none of them
1.2.1 $arguments
1.2.2 $argv
1.2.3 $_GET
1.2.4 $_SERVER
1.2.5 none of them
1.3 Which types are scalar in PHP?
1.3.1 float
1.3.2 null
1.3.3 object
1.3.4 array
1.3.5 none of them
1.3.1 float
1.3.2 null
1.3.3 object
1.3.4 array
1.3.5 none of them
1.4 Which operators used to compare two values that are not equal without automatic type conversion?
1.4.1 <=>
1.4.2 !=
1.4.3 <>
1.4.4 !==
1.4.5 =!
1.4.6 none of them
1.4.1 <=>
1.4.2 !=
1.4.3 <>
1.4.4 !==
1.4.5 =!
1.4.6 none of them
1.5 What we get after conversion string "e123x" to integer?
1.5.1 ex
1.5.2 123
1.5.3 e
1.5.4 false
1.5.5 0
1.5.6 none of them
1.5.1 ex
1.5.2 123
1.5.3 e
1.5.4 false
1.5.5 0
1.5.6 none of them
1.6 Which functions can find substring in string?
1.6.1 ucwords
1.6.2 parse_str
1.6.3 strstr
1.6.4 substr
1.6.5 strpos
1.6.6 array_search
1.6.7 none of them
1.6.1 ucwords
1.6.2 parse_str
1.6.3 strstr
1.6.4 substr
1.6.5 strpos
1.6.6 array_search
1.6.7 none of them
1.7 Which functions delete all duplicates from array?
1.7.1 array_intersect
1.7.2 array_unique
1.7.3 array_filter
1.7.1 array_intersect
1.7.2 array_unique
1.7.3 array_filter
1.7.4 array_replace
1.7.5 unset
1.7.6 none of them
1.7.5 unset
1.7.6 none of them
1.8 Which code add new elements to array `$arr`?
1.8.1 array_push($arr, 'banana');
1.8.2 array_fill($arr, 'banana');
1.8.3 $arr[] = 'banana';
1.8.4 $arr = $arr + ['banana'];
1.8.5 none of them
1.8.1 array_push($arr, 'banana');
1.8.2 array_fill($arr, 'banana');
1.8.3 $arr[] = 'banana';
1.8.4 $arr = $arr + ['banana'];
1.8.5 none of them
1.9 When an object is sent by argument to function then it ...
1.9.1 will be copied
1.9.2 will be cloned
1.9.3 passed by reference
1.9.4 passed by value
1.9.5 none of them
1.9.1 will be copied
1.9.2 will be cloned
1.9.3 passed by reference
1.9.4 passed by value
1.9.5 none of them
1.10 The pseudo-variable `$this` in class is reference to ...
1.10.1 non-static method in which it used
1.10.2 static method in which it used
1.10.3 class in which it used
1.10.4 object in which it used
1.10.5 none of them
1.10.1 non-static method in which it used
1.10.2 static method in which it used
1.10.3 class in which it used
1.10.4 object in which it used
1.10.5 none of them
1.11 Which keyword used to deny access from global scope and inheriting classes but can be accessed within the class itself?
1.11.1 private
1.11.2 protected
1.11.3 public
1.11.4 static
1.11.5 hidden
1.11.1 private
1.11.2 protected
1.11.3 public
1.11.4 static
1.11.5 hidden
1.11.6 none of them
1.12 Which magic methods called when we want to check existence of property which is inaccessible?
1.12.1 __get()
1.12.2 __set()
1.12.3 __isset()
1.12.4 __empty()
1.12.5 __alakazam()
1.12.6 none of them
1.12.1 __get()
1.12.2 __set()
1.12.3 __isset()
1.12.4 __empty()
1.12.5 __alakazam()
1.12.6 none of them
1.13 The special keywords `self` is used to access to ...
1.13.1 same as `$this`
1.13.2 static methods, properties and constants
1.13.3 parent class
1.13.4 non-static methods from current class
1.13.5 none of them
1.13.1 same as `$this`
1.13.2 static methods, properties and constants
1.13.3 parent class
1.13.4 non-static methods from current class
1.13.5 none of them
1.14 Which keyword can be used to reference the called class in a context of static inheritance?
1.14.1 $this
1.14.2 self
1.14.3 static
1.14.4 parent
1.14.5 __CLASS__
1.14.6 none of them
1.14.1 $this
1.14.2 self
1.14.3 static
1.14.4 parent
1.14.5 __CLASS__
1.14.6 none of them
1.15 Does PHP support multiple inheritance ?
1.15.1 yes
1.15.2 yes but with extension
1.15.3 no
1.15.4 no. traits used for it
1.15.1 yes
1.15.2 yes but with extension
1.15.3 no
1.15.4 no. traits used for it
1.15.5 depend on moon phase
1.15.6 none of them
1.15.6 none of them
2 SQL and MySQL
2.1 SQL is ... language
2.1.1 object-oriented
2.1.2 functional
2.1.3 declarative
2.1.4 imperative
2.1.5 none of them
2.1.1 object-oriented
2.1.2 functional
2.1.3 declarative
2.1.4 imperative
2.1.5 none of them
2.2 Which SQL statement is used to extract data from a database?
2.2.1 GET
2.2.2 EXTRACT
2.2.3 SELECT
2.2.4 OPEN
2.2.5 none of them
2.2.1 GET
2.2.2 EXTRACT
2.2.3 SELECT
2.2.4 OPEN
2.2.5 none of them
2.3 Which SQL statement delete all data from database?
2.3.1 REMOVE
2.3.2 DELETE
2.3.3 TRUNCATE
2.3.4 none of them
2.3.1 REMOVE
2.3.2 DELETE
2.3.3 TRUNCATE
2.3.4 none of them
2.4 With SQL, how do you select all the columns from a table named "Persons"?
2.4.1 SELECT * FROM Persons
2.4.2 SELECT Persons.* FROM Persons
2.4.3 SELECT [all] FROM Persons
2.4.4 SELECT *.Persons
2.4.5 none of them
2.4.1 SELECT * FROM Persons
2.4.2 SELECT Persons.* FROM Persons
2.4.3 SELECT [all] FROM Persons
2.4.4 SELECT *.Persons
2.4.5 none of them
2.5 With SQL, how can you insert "foo" as the "LastName" in the "Persons" table?
2.5.1 INSERT INTO Persons (LastName) VALUES ('foo')
2.5.2 INSERT ('foo') INTO Persons (LastName)
2.5.3 INSERT INTO Persons ('foo') INTO LastName
2.5.4 INSERT INTO Persons SET LastName='foo'
2.5.5 none of them
2.5.1 INSERT INTO Persons (LastName) VALUES ('foo')
2.5.2 INSERT ('foo') INTO Persons (LastName)
2.5.3 INSERT INTO Persons ('foo') INTO LastName
2.5.4 INSERT INTO Persons SET LastName='foo'
2.5.5 none of them
2.6 Which operator is used to select values within a range?
2.6.1 RANGE
2.6.2 BETWEEN
2.6.3 WITHIN
2.6.4 LIMIT
2.6.5 none of them
2.7 Which SQL query in MySQL will return all of the records in the right table (table B) that do not match any records in the left table (table A).?
2.7.1 SELECT * FROM Table_A A JOIN Table_B B ON A.Key = B.Key WHERE A.Key IS
NULL OR B.Key IS NULL;
2.7.2 SELECT * FROM Table_A A FULL OUTER JOIN Table_B B ON A.Key = B.Key WHERE
A.Key IS NULL OR B.Key IS NULL;
2.7.3 SELECT * FROM Table_A A RIGHT JOIN Table_B B ON A.Key = B.Key WHERE A.Key
IS NULL;
2.7.4 SELECT * FROM Table_A A INNER JOIN Table_B B ON A.Key = B.Key;
2.7.5 SELECT * FROM Table_A A UNION SELECT * FROM Table_B B;
2.7.6 none of them
2.7.1 SELECT * FROM Table_A A JOIN Table_B B ON A.Key = B.Key WHERE A.Key IS
NULL OR B.Key IS NULL;
2.7.2 SELECT * FROM Table_A A FULL OUTER JOIN Table_B B ON A.Key = B.Key WHERE
A.Key IS NULL OR B.Key IS NULL;
2.7.3 SELECT * FROM Table_A A RIGHT JOIN Table_B B ON A.Key = B.Key WHERE A.Key
IS NULL;
2.7.4 SELECT * FROM Table_A A INNER JOIN Table_B B ON A.Key = B.Key;
2.7.5 SELECT * FROM Table_A A UNION SELECT * FROM Table_B B;
2.7.6 none of them
2.8.5 none of them
3 JavaScript and jQuery
3.1 Inside which HTML element do we put the JavaScript?
3.1.1 <script>
3.1.2 <javascript>
3.1.3 <js>
3.1.4 <scripting>
3.1.5 none of them
3.1.1 <script>
3.1.2 <javascript>
3.1.3 <js>
3.1.4 <scripting>
3.1.5 none of them
3.2 Where is the correct place to insert a JavaScript?
3.2.1 in the beginning <head>
3.2.2 in the bottom of <head>
3.2.3 in the beginning <body>
3.2.4 in the bottom of <body>
3.2.5 in the beginning of <html>
3.2.6 none of them
3.2.1 in the beginning <head>
3.2.2 in the bottom of <head>
3.2.3 in the beginning <body>
3.2.4 in the bottom of <body>
3.2.5 in the beginning of <html>
3.2.6 none of them
3.3 Which code will call function `myfunc`?
3.3.1 myfunc('log')
3.3.2 myfunc.call(null, 'log')
3.3.3 myfunc.apply(null, 'log')
3.3.4 eval('myfunc("log")')
3.3.5 myfunc.bind('log')
3.3.6 Function.prototype.call.call(myfunc, null, ['log'])
3.3.7 none of them
3.3.1 myfunc('log')
3.3.2 myfunc.call(null, 'log')
3.3.3 myfunc.apply(null, 'log')
3.3.4 eval('myfunc("log")')
3.3.5 myfunc.bind('log')
3.3.6 Function.prototype.call.call(myfunc, null, ['log'])
3.3.7 none of them
3.4 Which jQuery methods will hide element from page?
3.4.1 $("p").hide();
3.4.2 $("p").toggle();
3.4.1 $("p").hide();
3.4.2 $("p").toggle();
3.4.3 $("p").disable();
3.4.4 $("p").off();
3.4.5 $("p").fadeOut();
3.4.6 $("p").display(none);
3.4.7 $("p").hidden();
3.4.8 none of them
3.4.4 $("p").off();
3.4.5 $("p").fadeOut();
3.4.6 $("p").display(none);
3.4.7 $("p").hidden();
3.4.8 none of them
3.5 Code `return false` from within a jQuery event handler will ...
3.5.1 disable propagation
3.5.2 disable bubbling
3.5.3 disable capturing
3.5.4 disable default event action
3.5.5 return false
3.5.6 none of them
3.5.1 disable propagation
3.5.2 disable bubbling
3.5.3 disable capturing
3.5.4 disable default event action
3.5.5 return false
3.5.6 none of them
3.6 Look at the following selector: `$("div")`. What does it select?
3.6.1 nothing
3.6.2 all div elements
3.6.3 the first div element
3.6.4 all tags with class `div`
3.6.5 first tags with class `div`
3.6.6 none of them
3.6.1 nothing
3.6.2 all div elements
3.6.3 the first div element
3.6.4 all tags with class `div`
3.6.5 first tags with class `div`
3.6.6 none of them
3.7 What is the correct jQuery code to set the background color of all p elements to red?
3.7.1 $("p").style("background-color","red");
3.7.2 $("p").css("background-color","red");
3.7.3 $("p").manipulate("background-color","red");
3.7.4 $("p").layout("background-color","red");
3.7.5 none of them
3.7.1 $("p").style("background-color","red");
3.7.2 $("p").css("background-color","red");
3.7.3 $("p").manipulate("background-color","red");
3.7.4 $("p").layout("background-color","red");
3.7.5 none of them
3.8 Which jQuery method is used to perform an asynchronous HTTP request?
3.8.1 jQuery.ajaxAsync()
3.8.2 jQuery.ajax()
3.8.3 jQuery.ajaxSetup()
3.8.4 jQuery.get()
3.8.5 jQuery.post()
3.8.6 jQuery.load()
3.8.7 none of them
3.8.2 jQuery.ajax()
3.8.3 jQuery.ajaxSetup()
3.8.4 jQuery.get()
3.8.5 jQuery.post()
3.8.6 jQuery.load()
3.8.7 none of them
3.9 Which statement is true?
3.9.1 To use jQuery, you can refer to a hosted jQuery library at Google
3.9.2 To use jQuery, you do not have to do anything. Most browsers (Internet
Explorer, Chrome, Firefox and Opera) have the jQuery library built in the
browser
3.9.3 To use jQuery, you must buy the jQuery library at www.jquery.com
3.9.4 none of them
3.9.1 To use jQuery, you can refer to a hosted jQuery library at Google
3.9.2 To use jQuery, you do not have to do anything. Most browsers (Internet
Explorer, Chrome, Firefox and Opera) have the jQuery library built in the
browser
3.9.3 To use jQuery, you must buy the jQuery library at www.jquery.com
3.9.4 none of them
4 CSS
4.1 What is the correct HTML for referring to an external style sheet?
4.1.1 <style src="mystyle.css">
4.1.2 <stylesheet>mystyle.css</stylesheet>
4.1.3 <link rel="stylesheet" type="text/css" href="mystyle.css">
4.1.4 none of them
4.1.1 <style src="mystyle.css">
4.1.2 <stylesheet>mystyle.css</stylesheet>
4.1.3 <link rel="stylesheet" type="text/css" href="mystyle.css">
4.1.4 none of them
4.2 Which is the correct CSS syntax?
4.2.1 {body;color:black;}
4.2.2 body:color=black;
4.2.3 {body:color=black;}
4.2.4 body: color(#000);
4.2.5 none of them
4.2.1 {body;color:black;}
4.2.2 body:color=black;
4.2.3 {body:color=black;}
4.2.4 body: color(#000);
4.2.5 none of them
4.3 How do you add a background color for all <h1> elements?
4.3.1 h1 {background-color:#FFFFFF;}
4.3.2 h1.all {background-color:#FFFFFF;}
4.3.3 all.h1 {color:#FFFFFF;}
4.3.4 h1 {bgcolor:#FFFFFF;}
4.3.5 h1 {background: #FFFFFF;}
4.3.6 none of them
4.3.2 h1.all {background-color:#FFFFFF;}
4.3.3 all.h1 {color:#FFFFFF;}
4.3.4 h1 {bgcolor:#FFFFFF;}
4.3.5 h1 {background: #FFFFFF;}
4.3.6 none of them
4.4 How do you display a border like this: top border - 10 pixels, bottom - 5 pixels, left - 20 pixels, right - 1 pixel?
4.4.1 border-width:10px 5px 20px 1px;
4.4.2 border-width:5px 20px 10px 1px;
4.4.3 border-width:10px 1px 5px 20px;
4.4.4 border-width:10px 20px 5px 1px;
4.4.5 none of them
4.4.1 border-width:10px 5px 20px 1px;
4.4.2 border-width:5px 20px 10px 1px;
4.4.3 border-width:10px 1px 5px 20px;
4.4.4 border-width:10px 20px 5px 1px;
4.4.5 none of them
4.5 How do you select all p elements inside a div element?
4.5.1 div + p
4.5.2 div.p
4.5.3 div > p
4.5.4 div ~ p
4.5.5 div < p
4.5.6 none of them
4.5.1 div + p
4.5.2 div.p
4.5.3 div > p
4.5.4 div ~ p
4.5.5 div < p
4.5.6 none of them
4.6 What is the value of the position property used to move element around his
original location?
4.6.1 static
4.6.2 relative
4.6.3 absolute
4.6.4 fixed
4.6.5 none of them
original location?
4.6.1 static
4.6.2 relative
4.6.3 absolute
4.6.4 fixed
4.6.5 none of them