Exécuter
❯
Exécuter le code
Ctrl+Alt+R
Changer d'orientation
Ctrl+Alt+O
Changer de thème
Ctrl+Alt+D
<!DOCTYPE html> <html> <body> <h2>La constante __TRAIT__</h2> <p>Cette constante renvoie le nom du trait :</p> <?php trait message1 { public function msg1() { echo __TRAIT__; } } class Welcome { utiliser message1; } $obj = new Welcome(); $obj->msg1(); ?> </body> </html>
La constante __TRAIT__
Cette constante renvoie le nom du trait :
message1