Friday 7 November 2014

Freelancer php test answers for php developer

If you are a freelancer on freelancer.com and want to work as a php and web developer then you need to pass Freelancer php test . As there is a problem on freelancer that :

1. You need to pay $5 per test
2. Time is so limited .

so without best preparation & best skill your money will be wasted . whatever to help you we provide you php test answers for php developer . we believe it will help a lot to php web developer to get a job on web development easily . we provide you this php test answers by 2 parts ..
php test answers for php developers



##Question :  Which of the following is the correct way to implement a do-while loop?
$j=0; do { print “$j”; } while ($j > 0);
##Question :  What kind of elements can be contained in constants?
All of these
Boolean
Float
String
integer
##Question :  Which statement will skip the rest of the current loop iteration and continue execution at the beginning of next iteration.
continue
##Question :  Which of the following is correct to show a message for an exception?
throw new Exception (“Invalid data”);
##Question :  Select the variable used to set the php.ini file to send emails containing the address of the default PHP mail sender.
sendmail_from
##Question :  Which configuration directive is used to transparently failover to other servers on errors?
memcache.allow_failover
##Question :  Which of the following is the not equal operator?
!=
##Question :  What are the levels of visibility possible for a variable or method?
Public, Private and Protected
##Question :  Which Perl Compatible Regex function inserts escape characters into strings that are intended for use as regex patterns.
preg_quote
##Question :  Which of the following shifts the bits of $a $b steps to the left?
$a << $b
##Question :  What PHP function returns the arctangent in radians of a numerical argument?
atan()
##Question :  Which function is used to start tracking a user?
session_start();
##Question :  What statement will delete session files?
session_destroy();
##Question :  How are sessions tracked on PHP With code rewriting using the PHP Session reference variable
##Question :  Which function changes server parameters and status at runtime?
Memcache::setServerParams
##Question :  Which function forces a write of all buffered output to the resource pointed to by the file handle?
fflush
##Question :  Single-line comments in PHP use the following: //
##Question :  The ability of a class to protect access to its internal member variables is called:
encapsulation
##Question :  You can use what function in order to check if a constant is set?
defined();
##Question :  Which of these will perform integer rather than floating point division?
intval(x/y);
##Question :  ______________ is a mechanism for storing data in the remote browser and thus tracking or identifying return users.
Cookies
##Question :  Using the Zip Archive Class, which of the following will include a file to a ZIP archive from a given path?
zipArchive::addFile
##Question :  Which of the following is an example of predefined cURL constant?
All of these CURLAUTH_ANYSAFE CURLFTPSSL_NONE CURLOPT_FILE CURLOPT_VERBOSE
##Question :  Which of the following refers to a set of functions that allows you have access to multiple supported databases without writing your own wrapper functions?
PHP DBX
##Question :  Which of the following is the correct syntax to retrieve an object from the memcache module? $result = $memcache->get(‘key’);
##Question :  _____________ attempts to establish an FTP connection to a remote server by emulating an FTP client.
FTP ftp_connect()
##Question :  Which of the following will open the file “time.txt” as readable?
fopen(“time.txt”,”r”);
##Question :  Which character must be set in the $mode argument for fopen($file, $mode) to open a file for reading and writing?
r+;
##Question :  Which of the following is the correct way to implement a “for” control structure?
for($i=0; $i<10; $i++){ // do something }
##Question :  Which of the following is the only keyword that can be written before the namespace at the top of the file?
declare
##Question :  What is the correct way to access the property of a PHP object?
$obj->property
##Question :  Select the convention sign used to indicate private variables and functions:
_ for $_name
##Question :  Arrays can be sorted with which of the following functions?
arsort(), ksort() and uksort();
##Question :  Private members are accessible to:
The class itself and the classes that inherit from it
##Question :  Which function returns the square root of its argument, with number of decimal places set by the optional scale factor?
bcsqrt()
##Question :  What does MIME stand for?
Multipurpose Internet Mail Extensions
##Question :  Which configuration directive defines a comma separated list of server urls to use for session storage?
session.save_path
##Question :  Which function gets permissions for the given file?
fileperms
##Question :  Which function checks whether a file or directory exists?
file_exists
##Question :  PHP constants:
All of these
Do not have a dollar sign ($) before them.
May be defined and accessed anywhere without regard to variable scoping rules
May not be redefined or undefined once they have been set.
May only evaluate to scalar values.
##Question :  Which PHP operator type allows evaluation and manipulation of specific bits within an integer?
Bitwise operators
##Question :  At compile time static values are bound with
a name
##Question :  What function raises the first argument to the power of the second argument, with decimal places to be specified by the scale factor?
bcpow
##Question :  Which Perl Compatible Regex character will cause any special character to be treated as a simple matching character?
\
##Question :  Session files should not be stored on a directory viewable from the Web server because:
Malicious users may access other users’ login details
49) What APIs are used for handling XML documents?
Document Object Model (DOM) and Simple API for XML (SAX)
##Question :  ________________ tests for the end of file on a file pointer.
feof()
##Question :  Include files must have the file extension:
none of these
##Question :  What is the term for using a class to create an object?
Instantiation
##Question :  PHP constants:
All of these apply
Can be accessed anywhere in the script regardless of the scope.
Can be used as default argument values.
Cannot change during the execution of the script.
Follow the same rules as labels in PHP.
##Question :  What term refers to the ability to shorten Extra_Long_Names improving readability of source code?
Aliasing
##Question :  Which operator performs the same function as x=x%y?
%=
##Question :  The control error operator is:
@
##Question :  Which statement can replace several else Statements?
switch
##Question :  To retrieve information from a form that is submitted using the “get” method, use ___________.
$_GET[];
##Question :  Which POSIX function takes a pattern, a target string, and an optional limit on the number of portions to split the string into.
split
##Question :  Which POSIX function takes the following two string arguments and an optional third-array argument: A POSIX-style regular expression pattern, and the target string to be matched?
ereg()
##Question :  Which PHP operator will attempt to execute its contents as a shell command?
(` `)
##Question :  What function takes any number of numerical arguments and returns the largest of the arguments?
max()
##Question :  To unregister a session variable STRING use:
session_unregister(STRING);
##Question :  Which of the following is correct to select a database in MS SQL?
mssql_select_db(STRING)
##Question :  Which PHP function is identical to the C fwrite() function?
fputs()
##Question :  Which function returns (and caches) the owner ID number?
fileowner()
##Question :  Which function writes a string to a file?
file_put_contents
##Question :  To denote strings in PHP, you can use both double quotes ” ” and which other characters?
single quotes ‘ ‘
##Question :  Which PHP operator type allows you to execute its contents as a shell command?
Execution operator
##Question :  PHP variables start with the following symbol:
$
##Question :  Instead of a single new line character some clients require which characters?
“\r\n”
##Question :  Which function parses input from a file according to a format?
fscanf
##Question :  Which file should be edited to set configuration directives?
php.ini
##Question :  Which of the following is correct in PHP?
Zero is interpreted as false
##Question :  Which of the following is the line to enable in the php.ini file for Windows in order to be able to use DBX?
extension=php_dbx.dll
##Question :  Which parameter of setcookie() defines the amount of time for which a cookie is valid?
expire
##Question :  Which control structure allows you to quickly traverse through an array?
foreach loops
##Question :  Which types of code can be affected by namespaces?
Classes, functions and constants.
Although any valid PHP code can be contained within a namespace, only four types of code are affected by namespaces: classes, interfaces, functions and constants.
##Question :  Which cURL function returns the last error number?
curl_errno
##Question :  Which of the following is an invalid constant name?
2DAY
##Question :  Which PHP operator allows you to assign values to variables and arrays?
“=”
##Question :  What is the term for breaking the binding between a variable name and variable content?
Unsetting references.
##Question :  Which is the operator for the integer remainder from the division of two values?
%
##Question :  Which predefined Memcache function turns on data compression?
MEMCACHE_COMPRESSED
##Question :  Which compressed file type can be decompressed without specifying the extension?
zip
##Question :  Which method defines HTTP Authentication using Apache Server?
.htaccess files
##Question :  What is the most widely accepted meaning of the acronym “PHP” today?
PHP: Hypertext Preprocessor
##Question :  Which configuration directive, in conjunction with memcache.allow_failover, defines how many servers to try when setting and getting data?
memcache.max_failover_attempts
##Question :  The correct way to create a numeric variable “v” that might have any real number is:
$v;
##Question :  Which of the following databases are supported by PHP?
All of these
MySQL abd MS SQL
Oracle and Informix
PostgreSQL and Frontbase
mSQL and Interbase
##Question :  Which of the following is the correct way to connect to a mySQL Server?
mysql_connect(SERVER, USER, PASSWORD);
##Question :  Which of the following will return variables from a form sent by the HTTP POST method in PHP?
$_POST
##Question :  Which version of PHP introduced object oriented programming?
PHP III
##Question :  Which of the following will correctly create a constant “const”?
const const;
##Question :  What variable is used by session cookies as a user ID?
$PHPSESSID
##Question :  Functions that represent a behavior of a class are called _________.
Methods
##Question :  Which zip function retrieves the compressed size of a directory entry?
zip_entry_compressedsize
##Question :  What does cURL stand for?
Client URL
##Question :  Which function clears the cache of file status info?
clearstatcache
##Question :  Which Perl Compatible Regex function takes a regex pattern as first argument, a string to match against as second argument, and an optional array variable for returned matches?
preg_grep
##Question :  Which API reads in an XML file and creates a “walkable” object tree in memory, so it can be used in large documents?
DOM
##Question :  _______________ defines a cookie to be sent along with the rest of the HTTP headers.
setcookie()

 

No comments:

Post a Comment