Jump to content

Call to undefined function deposit()


attaboy

Recommended Posts

What's undefined about deposit()?

 

class BankAccount {
private $name; 
var $balance = 0;
private $dep = 0;

function __construct() {
	if (array_key_exists ("deposit" , $_POST)) {
	$dep = $_POST['deposit'];
	echo $dep;
	deposit($dep);
	}
}

function deposit($dep) {
	$balance += $dep;
	echo $balance;
}
}

Link to comment
https://forums.phpfreaks.com/topic/261222-call-to-undefined-function-deposit/
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.