You Are Here: Home » Ecommerce Solution » Elance Advanced PHP test answers

Elance Advanced PHP test answers

What will be the output of the following code?

<?php
$a=”printf”;
$a(“hello”);
?>

  • Hello
  • Printf hello
  • Printf
  • Syntax error
  • None of the above

Answer: hello

=============================
What is the associativity of +=?

  • Left
  • Right
  • It is non-associative

What is the initial value of a variable?

  • 0
  • “0”
  • NULL
  • Any value

==================
Will the trim function strip NULL bytes?

  • Yes
  • No

=================================
What enctype is required for file uploads to work?

  • Multipart/form-data
  • Multipart
  • File
  • Application/octet-stream
  • None of the above

What will be the output of the following code?

<?php
$a=3;
print ‘$a’;
?>

  • 3
  • $a
  • Syntax error
  • None of the above

What is the size limit of strings in php?

  • 1024 bytes
  • 100Mbytes
  • 256Kbytes
  • There is no limit (hardware limit)

What is the output of the following code?
<?php
echo 0500;
?>

  • 100
  • 500
  • 0500
  • 320
  • None of the above

Can feof() be used with a file opened by fsockopen()?

  • Yes
  • No

What is “?:”?

  • A logical operator
  • A comparison operator
  • A ternary operator
  • A bitwise operator
  • None of the above

Which statement will return true?

  • Is_numeric(“200”)
  • Is_numeric(“20,0”)
  • Is_numeric(“$200”)
  • Is_numeric(“.25e4”)
  • None

Which function would you use to delete a file?

  • Delete()
  • Delete_file()
  • Unlink()
  • Fdelete()
  • File_unlink()

What will be the output of the following code?

<?php
print null==NULL;
?>

  • 1
  • 0

What will be the output of the following code?

<?php
$a=0*01;
$b=0*02;
printf(“%x”,($a<<$b.$b));
?>

  • 0
  • 1
  • 10000
  • 400000
  • 800000
  • Syntax error

Is sizeof a function?

  • Yes
  • No

What will be the output of the following code?

<?php
$a=”Hello”;
if(md5($a)===md5($a))
print “True”;
else
print “False”;
?>

  • True
  • False

What is the output of the following code?

<?php
echo 0*500;
?>

  • 500
  • 0*500
  • 0500
  • 1280
  • 320

What is the precedence between && and “and”?

  • && is higher than “and”
  • “and” is higher than &&
  • They have the same precedence
  • This operators don’t exist

Leave a Comment

Read previous post:
Opencart Version 1.5.2.1 is released detail description

ADDED: Order editing system Great changes done now on customer can reorder the product which s/he have already ordered.  ...

Close
Scroll to top