IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Langage PHP Discussion :

Erreur de syntaxe


Sujet :

Langage PHP

  1. #1
    Membre éclairé Avatar de ETVigan
    Homme Profil pro
    Conseil - Consultant en systèmes d'information
    Inscrit en
    Avril 2010
    Messages
    660
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Gard (Languedoc Roussillon)

    Informations professionnelles :
    Activité : Conseil - Consultant en systèmes d'information
    Secteur : Finance

    Informations forums :
    Inscription : Avril 2010
    Messages : 660
    Par défaut Erreur de syntaxe
    J'ai un souci avec la classe suivante:


    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
    34
    35
    36
    37
    38
    39
    40
    		class Stack extends CheckForm
    		{	public $stackMsg = array();
    			public $cntStack = 0 ;
    					
    			function __construct()
    			{	$this->emptyStack() ;  	}
    				
    			function __destruct()
    			{}
    				
    //          ==================================	
    //          All Error Stacking functions			
    //          ==================================	
    			public function getCntStack()
    557 ==>		{	return($this->cntStack) ; }
    
    			public function getStackError() // Public car function appelée fu formulaire...
    			{	user_error("getStackError[".$this->getCntStack()."]" , E_USER_NOTICE) ;	 
    				$str = "" ; 
    				print("getStackError ==>[".$this->getCntStack()."]") ;
    //				print_r($this->stackMsg); 
    				for ($i = 0 ; $i < $this->getCntStack() ; $i++)
    					$str .= $this->stackMsg[$i] ;
    				return($str) ; 
    			}
    				
    			public function stackMessage($msg)
    			{	$this->stackMsg[] = $msg . "<br>\n" ; 
    				$this->cntStack++ ; 
     				user_error("+++++++ Stacking msg[".$this->getCntStack()."][".$msg."]" , E_USER_NOTICE) ;	 
    				print("Stacking[".$msg."] - cntStack[".$this->getCntStack()."]") ;
    //				print_r($this->stackMsg); 
    			}
    				
    			public function emptyStack()
    			{	$this->cntStack = 0 ;
    				user_error("emptyStack[".$this->getCntStack()."]" , E_USER_NOTICE) ;	 
    				$this->stackMsg = array() ;	 
    			}
    		}

    Le log PHP me dit que:


    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
    [27-May-2010 18:24:18] PHP Notice:  Start Validating field[0]  cntStack[0] in F:\WebSites\test\checkform.php on line 651
    [27-May-2010 18:24:18] PHP Notice:  Undefined property: Text::$cntStack in F:\WebSites\test\checkform.php on line 557
    [27-May-2010 18:24:18] PHP Notice:  Validate[prenom]-[]-[3]-[30] cntStack[] in F:\WebSites\test\checkform.php on line 452
    [27-May-2010 18:24:18] PHP Notice:  Undefined property: Text::$cntStack in F:\WebSites\test\checkform.php on line 557
    [27-May-2010 18:24:18] PHP Notice:  ====> Validating.... cntStack[] in F:\WebSites\test\checkform.php on line 453
    [27-May-2010 18:24:18] PHP Notice:  Undefined property: Text::$cntStack in F:\WebSites\test\checkform.php on line 557
    [27-May-2010 18:24:18] PHP Notice:  ====> Filled cntStack[] in F:\WebSites\test\checkform.php on line 431
    [27-May-2010 18:24:18] PHP Notice:  Undefined property: Text::$cntStack in F:\WebSites\test\checkform.php on line 557
    [27-May-2010 18:24:18] PHP Notice:  ====> end of this validation[prenom].... cntStack[] in F:\WebSites\test\checkform.php on line 462
    [27-May-2010 18:24:18] PHP Notice:  End   Validating field[0]  cntStack[0] in F:\WebSites\test\checkform.php on line 654
    [27-May-2010 18:24:18] PHP Notice:  Start Validating field[1]  cntStack[0] in F:\WebSites\test\checkform.php on line 651
    [27-May-2010 18:24:18] PHP Notice:  Undefined property: Text::$cntStack in F:\WebSites\test\checkform.php on line 557
    [27-May-2010 18:24:18] PHP Notice:  Validate[nom]-[]-[3]-[30] cntStack[] in F:\WebSites\test\checkform.php on line 452
    [27-May-2010 18:24:18] PHP Notice:  Undefined property: Text::$cntStack in F:\WebSites\test\checkform.php on line 557
    [27-May-2010 18:24:18] PHP Notice:  ====> Validating.... cntStack[] in F:\WebSites\test\checkform.php on line 453
    [27-May-2010 18:24:18] PHP Notice:  Undefined property: Text::$cntStack in F:\WebSites\test\checkform.php on line 557
    [27-May-2010 18:24:18] PHP Notice:  ====> Filled cntStack[] in F:\WebSites\test\checkform.php on line 431
    [27-May-2010 18:24:18] PHP Notice:  Undefined property: Text::$cntStack in F:\WebSites\test\checkform.php on line 557
    Je ne comprends pas, +/- à chaque occurence de $cntStack, le même message est affiché par PHP.....

    En fait après autres tests, il apparait que c'est chaque occurence de getCntStack que ce message apparait !

    Question: pkoi test;;$cntStack et pas Stack::$cntStack qui est la classe propriétaire...... bien que j'ai une classe Text aussi qui appelle getCntStack..... poser la question s'est y répondre ?


    Qui pourra me dire ? Merci à lui

  2. #2
    Membre Expert
    Avatar de supersnail
    Homme Profil pro
    Inscrit en
    Novembre 2006
    Messages
    1 719
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations forums :
    Inscription : Novembre 2006
    Messages : 1 719
    Par défaut
    Bonjour,

    On peut voir la ligne 557 de ton programme?

  3. #3
    Membre éclairé Avatar de ETVigan
    Homme Profil pro
    Conseil - Consultant en systèmes d'information
    Inscrit en
    Avril 2010
    Messages
    660
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Gard (Languedoc Roussillon)

    Informations professionnelles :
    Activité : Conseil - Consultant en systèmes d'information
    Secteur : Finance

    Informations forums :
    Inscription : Avril 2010
    Messages : 660
    Par défaut Syntaxe
    la ligne en question est annoté en gras dans la 1ère fenêtre de code...

Discussions similaires

  1. [Directives] Page blanche quand erreur de syntaxe
    Par syl2095 dans le forum EDI, CMS, Outils, Scripts et API
    Réponses: 12
    Dernier message: 17/02/2006, 16h15
  2. [sql] erreur de syntaxe
    Par cmoa59 dans le forum JDBC
    Réponses: 14
    Dernier message: 03/05/2005, 12h41
  3. erreur de syntaxe en C++
    Par sergepmessa dans le forum C++
    Réponses: 6
    Dernier message: 11/03/2005, 19h15
  4. PHP SQL =>erreur de syntaxe (operateur absent)
    Par snipes dans le forum Langage SQL
    Réponses: 3
    Dernier message: 23/02/2005, 15h09
  5. erreur de syntaxe javascript dans ma page
    Par Oluha dans le forum Général JavaScript
    Réponses: 7
    Dernier message: 01/02/2005, 15h53

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo