I\'m using PHP 5.2.6. I want to have a default value for an argument in a method, but it seems I\'m getting a bit too clever.
The class property blnOverwrite>
You must do it that way, afaik, or use a class constant since php 5.3 but of course its fixed and cant be changed later so i would definitely go with your own solution:
class foo{
const constant = 'bar';
public function place($path, $overwrite = self::constant ) {
die('bla' . $overwrite);
}
}
$bar = new foo();
$bar->place('baz');