This site is mobile accessible. Press the "Tap Here" button to use a different font-size.
Smartphone icons created by Freepik - Flaticon
<?php class Goodbye { const LEAVING_MESSAGE = "Thank you for visiting W3Schools.com!"; } echo Goodbye::LEAVING_MESSAGE; ?>
Or, we can access a constant from inside the class by using the
keyword followed by the scope resolution operator ( ) followed by the constant name, like here:<?php class Goodbye { const LEAVING_MESSAGE = "Thank you for visiting W3Schools.com!"; public function byebye() { echo self::LEAVING_MESSAGE; } } $goodbye = new Goodbye(); $goodbye->byebye(); ?>
Eventually the navigation links, above, will be replaced by these (previous) and (next) buttons below.
Animated PHP icons used in the buttons provided by ICONS8.COM. Smartphone icons created by Freepik - Flaticon
Module 6 quiz