Zend PHP 5.3 Certification 200-530 Question # 2 Topic 1 Discussion

Zend PHP 5.3 Certification 200-530 Question # 2 Topic 1 Discussion

200-530 Exam Topic 1 Question 2 Discussion:
Question #: 2
Topic #: 1

Which of the listed changes would you make to the following PHP 4 code in order to make it most compliant with PHP 5? (Choose 2)

<?php

class Car {

var $model;

function Car($model) {

$this->model = $model;

} function toString() {

return "I drive a $this->model.";

}}

$c = new Car('Dodge');

echo $c->toString();

?>


A.

Change var to public or private


B.

Change function Car to function_construct


C.

Change "I drive a $this->model." to "I drive a {$this->model}."


D.

Change function toString()to static function toString()


Get Premium 200-530 Questions

Contribute your Thoughts:


Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.