Jump to content

OOP nobb Q - simple object won't show


nomadsoul

Recommended Posts

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?

Link to comment
https://forums.phpfreaks.com/topic/163949-oop-nobb-q-simple-object-wont-show/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.