Jump to content

Classes help


parino_esquilado

Recommended Posts

Take the following example:

 

<?php
class a {
var $things;
public function __construct($stuff) {
	$this->things = $stuff;
}	
}
class b {
var $morethings;
$this->morethings = "something";
}

$c = new a(new b);

echo $c->things->__PARENT__;
?>

 

The line "echo $c->things->__PARENT__;" (as you can probably imagine) does not work. How would I output what the 'b' object is stored in ('a')?

Link to comment
https://forums.phpfreaks.com/topic/225476-classes-help/
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.