Jump to content

Help Need


Danny620

Recommended Posts

<?php

class Building{
public $name;
public $current = 1;
public $upgrade;

function Upgrade(){
	$this->upgrade = $this->current + 1;
}

function get_upgrade(){
	return $this->upgrade;
}
}

$Building = new Building();

$upgrade = $Building->get_upgrade();
echo $upgrade;
?>

 

it should return 2 but it dont

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