title: Php: creating functions in a for () loop
body: <p>Does anybody know how I could write a function, that was able to create other functions, using the contents of a variable for it's name?</p>
  
  <p>Here's a basic example of what I'm talking about in php:</p>
  
  <pre><code>function nodefunctioncreator()
    {
      for ($i =1, $i &lt; 10, $i++)
        {
        $newfunctionname = "Node".$i;
        function $newfunctionname()
          {
          //code for each of the functions
          }
        }
    }
  </code></pre>
  
  <p>Does anybody know a language that would allow me to do this?</p>