Jump to content

OOP in PHP Tutorial


Amethyst

Recommended Posts

I am new to OOP and was very pleased to find the tutorials by Stefan. However, I have run into some problems.

 

1. When creating an object with a constructor, I do not get any value back.

 

// Create an object with a constructor
$stefan = new person("Stefan Mischook");
echo "
Stefan's full name: " . $stefan->get_name();

 

The code above just prints out: Stefan's full name:

 

2. I uploaded Stefan's source code examples and do not get values back from those either. My server also reports errors on the public and protected functions in his code.

 

I have PHP 5.2.5 and I am on a shared server.

 

Does anyone know what the problem might be?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...