This forum is now read-only. Please use our new forums! Go to forums
1/8 - error on constant
I noticed many of the QA examples are assigning a value on the same line that introduces the constant, but the hints suggest stating it as it’s own property. I can’t get it to work.
Here is my code:
<?php
class Person {
public function say(){
echo "Here are my thoughts!";
}
}
class Blogger extends Person {
const cats;
static public $cats= "50";
static public function catcall(){
echo $cats;
}
}
Blogger::catcall();
?>
Answer 52e616569c4e9df420001601
on 1/8 the assignment is only to call the function. I assume because you are calling Blogger::catcall();
you are on step 8/8. you are supposed to put static in the person class, also when you are supposed to write it like this: public static function functionname() {
(that is all in the person class) Inside blogger cats the only thing you should have is const cats = 50;
. It isn’t supposed to be called catcall()
its supposed to be called say()
. You fail to echo the cats
value as well.
Popular free courses
- Free Course
Learn SQL
In this SQL course, you'll learn how to manage large datasets and analyze real data using the standard data management language.Beginner friendly,4 LessonsLanguage Fluency - Free Course
Learn JavaScript
Learn how to use JavaScript — a powerful and flexible programming language for adding website interactivity.Beginner friendly,11 LessonsLanguage Fluency - Free Course
Learn HTML
Start at the beginning by learning HTML basics — an important foundation for building and editing web pages.Beginner friendly,6 LessonsLanguage Fluency