Jump to content

Oop For Beginners


Recommended Posts

Hello sir,


i encounter an error in code of oop php for beginners


( ! ) Notice: Use of undefined constant name - assumed 'name' in C:\wamp\www\clss\class_lib.php on line 32




protected function set_name($new_name)



if (name != "Jimmy Two Guns ") ---> line 32



$this->name = strtoupper($new_name);





I am new to oop so i really do not know what to with this error... i have codes from your tutorial web site ^_^


Thank you!

Link to comment
Share on other sites

Getting a few weird errors when following this tutorial.

Code seems to be working as it should be but im still getting these warnings.




Site Code:






don't seem to know the problem here either,

the code seems identical to the tutorial apart from the string output.

Link to comment
Share on other sites

  • 6 months later...

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.

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.

  • Create New...