Online PHP Getter and Setter Generator
How To Use
Copy and paste your PHP instance variables into the textarea, press Go, and copy and paste the output. This script will automatically detect PHP4 and PHP5 code.
Example Code
For PHP 4, submitting this:
var $dude; var $whoa;
Will get you this:
function getDude() { return $this->dude; }
function getWhoa() { return $this->whoa; }
function setDude($x) { $this->dude = $x; }
function setWhoa($x) { $this->whoa = $x; }
In PHP 5, submitting this:
protected $dude; private $whoa;
Will get you this:
public function getDude() { return $this->dude; }
public function getWhoa() { return $this->whoa; }
public function setDude($x) { $this->dude = $x; }
public function setWhoa($x) { $this->whoa = $x; }
Limitations
I threw this together pretty quick, so I haven't had time to do much error checking. Keep your submissions clean and to the point. If you do stuff like add comments ("//") after the semicolons, it'll goof this up. I'll check for that stuff later, but I needed this script right now.