Muck A. Round Posted August 4, 2021 Share Posted August 4, 2021 When I "Try it yourself" on the first example, and hit RUN, nothing appears in the right box. Is this correct? If so, I'm not sure of the point. Below is the code for that example. <!DOCTYPE html> <html> <body> <?php class Fruit { // Properties public $name; public $color; // Methods function set_name($name) { $this->name = $name; } function get_name() { return $this->name; } } ?> </body> </html> Link to comment Share on other sites More sharing options...
Ingolme Posted August 5, 2021 Share Posted August 5, 2021 That is correct. The code defines a class, but nothing will happen if you don't use the class. Do they really have a try-it example with this code? Link to comment Share on other sites More sharing options...
Muck A. Round Posted August 5, 2021 Author Share Posted August 5, 2021 23 hours ago, Ingolme said: That is correct. The code defines a class, but nothing will happen if you don't use the class. Do they really have a try-it example with this code? Yes - that's the code copy/pasted from the "Try it yourself". So they could have explained nothing would happen (or even not bother making it a "Try it yourself" when trying it doesn't do anything except show you the code again?). Looking at subsequent examples, I see that more code is necessary. It's good to know what these layers of code do, but was a little confusing when you hit the button and nothing happens. Link to comment Share on other sites More sharing options...
Muck A. Round Posted August 8, 2021 Author Share Posted August 8, 2021 On 8/5/2021 at 10:21 AM, Ingolme said: Do they really have a try-it example with this code? It seems there are more examples later in this section where they have a "Try it yourself" but the code doesn't produce anything in the output. It would be clearer if they either modified the code to produce at least something, or explain that the code won't produce any output because xyz. Link to comment Share on other sites More sharing options...
Ingolme Posted August 8, 2021 Share Posted August 8, 2021 At the bottom of each page they have a button labelled "report error". You can provide suggestions to them from there. Link to comment Share on other sites More sharing options...
Muck A. Round Posted August 8, 2021 Author Share Posted August 8, 2021 2 minutes ago, Ingolme said: At the bottom of each page they have a button labelled "report error". You can provide suggestions to them from there. Thanks 🙂 I'll put my suggestions there. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now