Jump to content

the limits of PHP


Shadowing

Recommended Posts

My guess is that your version of rand() could only seem to come up with 5048 unique values.  That also explains why my code just looped forever because mine would not stop until you reached 600,000 unique values which for some reason your setup is incapable of doing.  I have no idea why your implementation of rand() seems to be so poor.    What OS and PHP version are you using?

Link to comment
Share on other sites

The larger map generator that uses the code ive been using in the example still wont work though. so I came up with an idea. I could use sleep() so every 100 stars or what ever i make it sleeps for 2 seconds. I just did a test on 10 by 10 stars and it seems to be working so far.

 

 

my map generator consist of  a few functions

 

to make a unique stargate address

to prevent stars from being to close to each other

to make a unique random planet name

and to random a number for a picture.

 

Thats why I was creating 600k stars cause i really only need liek 150k but im running more functions. I asked my question in the apache forum to see why i have this time out issue. If sleep() is working then that means im simply running out of resources i would think.

Link to comment
Share on other sites

Ahh this sleep idea is working. what happends when a page loads is there some sort of cache flush or something that resets the resources? cause i was thinking if there is a function I can use to reset what ever it is that is being maxed out. then instead of me using sleep() i can just simply reset it.

 

anyone know what gets reset after every page load? and if there is a function I can do to make it do the task.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.