nomadsoul Posted June 28, 2009 Share Posted June 28, 2009 Hi, I've been doing standard php off and on for a few years and decided to learn OPPphp starting with Stephan Mishtook's decent video tut. Problem: simple name object won't show in the browser (just a blank page, no default errors) Using LAMP with full permissions. Php 5 Here is the index.php: <html> <head> <title>OPP in PHP</title> <?php include("class_lib.php"); ?> </head> <body> <?php $bruce new person(); echo $bruce->get_name(); ?> </body> </html> And here is the class file: <?php class person { var $name = "bruce"; function get_name(){ return $this->name; } } ?> Where do the OOP questions on this message board go? Quote Link to comment https://forums.phpfreaks.com/topic/163949-oop-nobb-q-simple-object-wont-show/ Share on other sites More sharing options...
Ken2k7 Posted June 28, 2009 Share Posted June 28, 2009 OOP questions go in the PHP forum. As for your problem, you messed up the assignment in the variable $bruce. $bruce new person(); See the error? You forgot the assignment or = sign. It should be - $bruce = new person(); Quote Link to comment https://forums.phpfreaks.com/topic/163949-oop-nobb-q-simple-object-wont-show/#findComment-864935 Share on other sites More sharing options...
nomadsoul Posted June 28, 2009 Author Share Posted June 28, 2009 Thanks for your help. It is typical of me to miss something like that Quote Link to comment https://forums.phpfreaks.com/topic/163949-oop-nobb-q-simple-object-wont-show/#findComment-864942 Share on other sites More sharing options...
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.