par
djun » 29 févr. 2012, 23:02
Bonjour, Lors que j'ai faite mon code. Sa affiche:
Mes erreurs sont:
Code : Tout sélectionner
( ! ) Fatal error: Uncaught exception 'MonException' with message 'Votre password est incorrect !' in C:\wamp\www\MaPage.php on line 19
( ! ) MonException: Votre password est incorrect ! in C:\wamp\www\MaPage.php on line 19
Mon code:
<?php
class MonException extends Exception
{
private final function getDate($r, $j, $h, $m, $s)
{
echo $j ,' ', $r ,' à ', $h ,':', $m ,' et ', $s ,' seconde' ;
}
public function __construct($message=NULL, $r, $j, $h, $m, $s, $code=0)
{
parent::__construct($message, $code) ;
echo $this->getDate($r, $j, $h, $m, $s) ;
}
}
$password = 'Mine';
if('Diki' !== $password) {
throw new MonException('Votre password est incorrect !', 'févirer', 29, 15, 45, 03);
}
?>
Bonjour, Lors que j'ai faite mon code. Sa affiche:
[code]29 févirer à 15:45 et 3 seconde[/code]
Mes erreurs sont:
[code]( ! ) Fatal error: Uncaught exception 'MonException' with message 'Votre password est incorrect !' in C:\wamp\www\MaPage.php on line 19
( ! ) MonException: Votre password est incorrect ! in C:\wamp\www\MaPage.php on line 19[/code]
Mon code:
[php]<?php
class MonException extends Exception
{
private final function getDate($r, $j, $h, $m, $s)
{
echo $j ,' ', $r ,' à ', $h ,':', $m ,' et ', $s ,' seconde' ;
}
public function __construct($message=NULL, $r, $j, $h, $m, $s, $code=0)
{
parent::__construct($message, $code) ;
echo $this->getDate($r, $j, $h, $m, $s) ;
}
}
$password = 'Mine';
if('Diki' !== $password) {
throw new MonException('Votre password est incorrect !', 'févirer', 29, 15, 45, 03);
}
?>[/php]