salut,
je suis débutant au développement en PHP5
le but de mon code est d'afficher
0 0
5 6
mais il m'affiche
6 6
le code est
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33 <?php class point { public $x; public $y; function _construct() //constructeur { $this->x=0; $this->y=0; } function affiche() //fonction d'affichage { echo $this->x; echo $this->y; } function deplacer($dx,$dy) //fonction deplacer { $this->x=$this->x+$dy; $this->y=$this->y+$dy; } } $p=new point(); //construction d'un objet de type poit $p->affiche(); // doit afficher 0 0 $p->deplacer(5,6); $p->affiche(); //doit afficher 5 6 ?>
pouvez m'aidez
merci d'avance
Partager