Main Snake Zend Zend Questions Exam Quicktest MZend Zend-Race

12m 00s


Question: 1 (ID:569)

ID: 569


Consider the following script:


                        
$string = "<b>I like 'PHP' & I think it is \"cool\"</b>";
var_dump(htmlentities($string, ENT_QUOTES));
var_dump(htmlspecialchars($string));                    

In this script, do the two var_dump() calls produce the same string? Why or Why Not?



Question: 2 (ID:386)

ID: 386


What is the output of the following PHP script?


                        
$arr = array_flip(['a' => 1, 'b' => 2, 'c' => 3]);
foreach (array_values($arr) as $k => $v) {
    echo $k;
}                    



Question: 3 (ID:723)

ID: 723


What happens when the script below is executed ?


                        
$a = array(1,2,3);
$b = array(7,8,9);

$counta = count($a);
$countb = sizeof($b);

if ($counta===$countb) {
    echo "They are equal and have the same type";
} else {
    echo "They are not equal or they are not of the same type";
}                    



Question: 4 (ID:632)

ID: 632


What is the output of the following script?


                        
class ClassOne {
    protected $a = 10;
    public function changeValue($b) {
        $this->a = $b;
    }
}

class ClassTwo extends ClassOne {
    protected $b = 10;
    public function changeValue($b) {
        $this->b = 10;
        parent::changeValue($this->a + $this->b);
    }
    public function displayValues() {
        print "a: {$this->a}, b: {$this->b}\n";
    }
}

$obj = new ClassTwo();
$obj->changeValue(20);
$obj->changeValue(10);
$obj->displayValues();                    



Question: 5 (ID:162)

ID: 162


Which of the following functions can be used as a countermeasure to a Shell Injection attack? Each correct answer represents a complete solution. Choose all that apply.





Question: 6 (ID:8)

ID: 8


What will be the output of the following PHP script:


                        
function modifyArray(&$array) {
    foreach ($array as &$value) {
        $value = $value + 2;
    }
    $value = $value + 3;
}

$array = array(1, 2, 3);
modifyArray($array);
print_r($array);                    



Question: 7 (ID:459)

ID: 459


Which of the following statements are true when applied to a Registry pattern? (choose two)





Question: 8 (ID:352)

ID: 352


What is the output of the following script?


                        
$number = 25;
if ($number <= 25) {
    echo "lte";
} else if ($number == 25) {
    echo "e";
} else if ($number >= 25) {
    echo "gte";
} else {
    echo "o";
}                    

Enter the exact script output



Question: 9 (ID:217)

ID: 217


Consider the following script:


                        
$string1 = "ab";
$string2 = "cd";
$string1 = $string1 . $string2; 
$string3 = "abc";
$string1 .= $string3;
echo $string1;                    

What will be the output of the above PHP script?



Question: 10 (ID:657)

ID: 657


Which function is best suited for removing markup tags from a string?