This forum is now read-only. Please use our new forums! Go to forums
8/8 - Putting It All Together - My Solution
After fighting and fighting with the code, I recalled an earlier exercise that wouldn’t work until I added the HTML and BODY tags. Once I did that the code worked.
Your code may be perfect and the system simply won’t accept it until you add the tags.
<html>
<head>
<title>
</title>
</head>
<body>
<p>
<?php
class Person
{
public static function say()
{
echo "Here are my thoughts!";
}
}
class Blogger extends Person
{
const cats = 50;
}
Blogger::say();
echo Blogger::cats; ?>
</p>
</body>
</html>
Answer 53bbe9b780ff33d0aa000d42
Answer 53bbece6282ae37034000f76
0 votes
You’re right. I never reset the code to see. I guess I stripped out the tags when working on the code. Oops.
Answer 53d1316852f863733d000149
0 votes
$blogger = Blogger(); echo blogger::cats; // since “cats” is constant and not static.
Hope it helps :)
Answer 53f0c4627c82ca7cea001cf2
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
1 comments
It’ll probably also work without the HTML and BODY-tags, as long as you put your code in between