 <p>If you want to create a new object from a class of which the name is stored in a string, you can use:</p> <pre><code>$object = new $className(); </code></pre> <p>Or in your case:</p> <pre><code>$option = new $_POST['option_name'](); $option-&gt;calculated(); $option-&gt;create_record_for_database(); </code></pre> <p>However, I personally don't like the idea of using variables like this.</p>