- Messages
- 4,148
- Reaction score
- 5
- Points
- 38
I am creating a series of libraries and have run into a few major issues.
The problems are as follows :
when I include a file that only holds a few variables and then include it again by calling include_once, it doesn't redeclare them.
The biggest problem I am having is I have 2 scripts that contain almost the same function, it is declared by the same name.
A mt_rand() function chooses between the 2, but the catch is on some runs of the script it runs both functions and dies with a fatal error : cannot redeclare function ...
Is there a way of undeclaring a function and then redeclaring it.
Another one, when a script is required or required_once php reads in the contents right. So if i where to call the same function from that script twice. Does the function stay as is and run as expected ?
The problems are as follows :
when I include a file that only holds a few variables and then include it again by calling include_once, it doesn't redeclare them.
The biggest problem I am having is I have 2 scripts that contain almost the same function, it is declared by the same name.
A mt_rand() function chooses between the 2, but the catch is on some runs of the script it runs both functions and dies with a fatal error : cannot redeclare function ...
Is there a way of undeclaring a function and then redeclaring it.
Another one, when a script is required or required_once php reads in the contents right. So if i where to call the same function from that script twice. Does the function stay as is and run as expected ?