php mcq questions with answers


                                
When you need to process the values of columns in a database, you should:
A.Only use built-in database functions
B.Always use read the values as-is from the database and then process them with PHP
C.Use built-in database functions for simple processing, and perform more complicated logic in PHP
D.Use built-in database functions for complicated logic, and perform simpler functions in PHP
                                
How do you allow the caller to submit a variable number of arguments to a function?
A.Using a prototype like function test(... $parameters).
B.Using a prototype like function test() and the function func_get_args() inside the function body.
C.Using a prototype like function test($parameters[]).
D.Using a prototype like function test() and the function get_variable_args() inside the function body.
E.This is not possible in PHP.
                                
When PHP is running on a command line, what super-global will contain the command line arguments specified?
A.$_SERVER
B.$_ENV
C.$GLOBALS
D.$_POST
E.$_ARGV
                                
.In the following code, which class can be instantiated? <?php abstract class Graphics { abstract function draw($im, $col); } abstract class Point1 extends Graphics { public $x, $y; function __construct($x, $y) { $this->x = $x; $this->y = $y; } function draw($im, $col) { ImageSetPixel($im, $this->x, $this->y, $col); } } class Point2 extends Point1 { } abstract class Point3 extends Point2 { } ?>
A.Graphics
B.Point1
C.Point2
D.Point3
E.None, the code is invalid
                                
Which of the following are valid SoapClient calls? (Choose 2)
A.$client = new SoapClient("weather.wsdl");
B.$client = new SoapClient;
C.$client = new SoapClient(null, array("location" => "http://example.com/weather", "uri" => "http://test-uri.com/"));
D.$client = new SoapClient(null, array());