Jump to content
View in the app

A better way to browse. Learn more.

Next

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Comment dois-je faire pour arrêter ma class

Featured Replies

Salut,

class test {

function a($chaine){
	//...
}

function b(){
	//...
}

function c(){
	//...
}

}

$test = new test();

$test->a("$chaine");
$test->b(""); 
$test->c("");

Comment dois je faire pour arrêter l'exécution de $test->b(""); et $test->c("");

Si $test->a("$chaine "); contient des caractères spéciaux non désirer par la méthode a().

car je penses qu'il vas fair du calcul en plus inutillement.

Merci

Un semble "if" vérifiant l'inexistence de ces caractères spéciaux :

if (...) {
 $test->b("");
 $test->c("");
}

Après reste à savoir quels sont ces caractères spéciaux à rechercher. Et ce test tu veux le faire sur la chaine en paramètre ou sur ce que revoit la méthode a ? :zarb:

PS : :francais: de penser à la balise code.

PS 2 : dans ton implémentation, les méthodes b et c requièrent un paramètre ?

Ça serait possible que tu apportes 2-3 précisions, melodia ? Il me semble difficile d'aider tant que je ne comprend pas le problème. :mdr:

Tu utilises quel langage de programmation ? (PHP4 ?)

Que veux-tu dire par "arrêter l'exécution des méthodes" ?

Éventuellement détaille un petit peu plus ton code (méthode "a", "b" et "c" c'est pas très parlant).

En attendant ta réponse, si la réponse de Quarky n'est pas déjà suffisante.

  • Author

Salut, merci pour vos réponses

J'utilise PHP5 comme language.

En faîte je n'avais pas bien saisi les classes, et en cherchant à vous expliquer le problème, j'ai compris comment je dois utiliser ma classe et l'instanciation.

Archived

This topic is now archived and is closed to further replies.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.