# List of functions

**URL:** <https://forum.kirupa.com/t/list-of-functions/269971>\
**Category:** Uncategorized\
**Created:** [September 3, 2008, 6:07pm UTC](https://forum.kirupa.com/t/list-of-functions/269971 "2008-09-03T18:07:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dhryn](https://avatars.discourse-cdn.com/v4/letter/d/47e85d/32.png) [@Dhryn](https://forum.kirupa.com/u/Dhryn)\
**Post date:** [September 3, 2008, 6:07pm UTC](https://forum.kirupa.com/t/list-of-functions/269971/1 "2008-09-03T18:07:38Z")

</div>

I want to create a list of functions that can be run by a numerical variable without if statements.

I have tried to create an array and then store functions in that array as follows

$funcs = array();  
$funcs[4] = function() {  
//function code in here  
}

and then to run the function I will do the following

$num = 4;  
$funcs$num;

However, when I run the code I get the following error

Parse error: syntax error, unexpected T\_FUNCTION

Does anyone know where I am going wrong or if there is an alternative way of achieving the same goal?

Any help would be great.
