franzjo Posted October 2, 2013 Report Posted October 2, 2013 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! Quote
falkencreative Posted October 2, 2013 Report Posted October 2, 2013 When you get an "undefined constant", it tends to mean that you forgot to include a "$" that indicates a bit of text is a variable. In this case, I believe that "name" in line 32 should be "$new_name" -- I believe that should fix the error. Quote
Goon3r Posted October 6, 2013 Report Posted October 6, 2013 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. Quote
rabidin Posted April 18, 2014 Report Posted April 18, 2014 I very much enjoyed the first 7 videos on OOP for beginners. Are there any more? Quote
administrator Posted April 18, 2014 Report Posted April 18, 2014 Not in that series but we have project based courses that continue from there and I plan on working on something to add to that series specifically in the future. Not sure when ... but soon I suspect. Quote
Recommended Posts
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.