0

I'm editing someone else's code and I have a vague idea of what it does, but if anyone has seen this kind of thing and can explain it to me.

function mkdir_recursive($pathname, $mode)
	{
		is_dir(dirname($pathname)) | mkdir_recursive(dirname($pathname), $mode);
		return is_dir($pathname) || @mkdir($pathname, $mode);
	}

I don't understand why it's calling itself, and I know it's conditional execution but I can't figure out what to search for in the PHP manual. When I search for conditional execution it comes up with an entirely different subject.

The error it give is:

Fatal error: Allowed memory size of 1610612736 bytes exhausted (tried to allocate 20 bytes) in /home/picfreez/public_html/upload_image.php on line 14

If I // the call to this function out it works just fine, but if a new user signs up they'll need this function(or something like it) working.

Help! :)

David

2
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by dietdew12z
0

I hate it when code suddenly starts working.

Right after posting my question and without making any changes in the code it suddenly stopped giving me errors and started working flawlessly.

Thank you for the reply, if it gives problems again I'll just replace the code in the function with the proper code. :)

I'm not terribly impressed by the person who started this project.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.