How would you correct it?
The following code piece should print “PHP is cool”, but unexpectedly, it just prints “cool”. How would you correct it?
<code>
echo str_replace(‘PHP is a pain.’, ‘a pain’, ‘cool’);
</code>
What will the following function call print?
What will the following function call print?
<code>
printf(‘%010.6f’, 22);
</code>
In the following code, which class can be instantiated?
In the following code, which class can be instantiated?
<code>
1 <?php
2 abstract class Graphics {
3 abstract function draw($im, $col);
4 }
5
6 abstract class Point1 extends Graphics {
7 public $x, $y;
8 function __construct($x, $y) {
9 $this->x = $x;
10 $this->y = $y;
11 }
12 function draw($im, $col) {
13 ImageSetPixel($im, $this->x, $this->y, $col);
14 }
15 }
16
17 class Point2 extends Point1 { }
18
19 abstract class Point3 extends Point2 { }
20 ?>
</code>
An object can be counted with count() and sizeof() if it
An object can be counted with count() and sizeof() if it
What is the output of the folowing code? <code> 1 <?
What is the output of the folowing code?
<code>
1 <?php
2 echo ‘1’ . (print ‘2’) + 3;
3 ?>
</code>
What happens if you try to access a property whose name is defined in a parent class as private, and is not de
What happens if you try to access a property whose name is defined in a parent class as private,
and is not declared in the current class?
The purpose of the singleton pattern is to..
The purpose of the singleton pattern is to…
Is the following code piece E_STRICT compliant?
Is the following code piece E_STRICT compliant?
<code>
final class Testing {
private $test;
public function tester() {
return “Tested!”;
}}
</code>
What will the $array array contain at the end of this script?
What will the $array array contain at the end of this script?
<code>
1 <?php
2 function modifyArray (&$array)
3 {
4 foreach ($array as &$value)
5 {
6 $value = $value + 1;
7 }
8
9 $value = $value + 2;
10 }
11
12 $array = array (1, 2, 3);
13 modifyArray($array);
14 ?>
</code>
where would the information about this file be available?
When uploading a file to a PHP script using the HTTP PUT method, where would the information
about this file be available?