Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7559243
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T12:35:21+00:00 2026-05-30T12:35:21+00:00

I use PHP for programming contests (bad choice, I know. But it’s the only

  • 0

I use PHP for programming contests (bad choice, I know. But it’s the only language I’m good at). Often, when I create a very large variable, PHP returns a blank page. No errors are generated.

For example, if I have a script like this:

<?php
echo 'test';

$var=array();
for($i=0;$i<9999999999;$i++){
  $var[]=$i*9999999999;
}

No output would be outputted; not even the “test”.

Is there a way to prevent this?

P.S. The script usually terminates quickly, in about 2-3 seconds. Which leads me to think that PHP is terminating the script without reaching the end.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T12:35:22+00:00Added an answer on May 30, 2026 at 12:35 pm

    More than likely you are getting a

    Fatal error: Allowed memory size of 134217728 bytes exhausted
    

    There are a few things that can be done to change this as well as to display the error. One is to either change error reporting in your php.ini file or to add

    error_reporting(E_ALL);
    ini_set("display_errors", 1);
    

    at the top of your code. The second would be increase the allowed size.

    You are using a lot of memory trying to multiply this large of a number that many times. What is the reason you are trying to do this? Is there a different way you might be able to do the same thing?

    Here are a few resources you can use

    to increase the size http://www.mydigitallife.info/php-allowed-memory-size-exchausted-fatal-error/

    Error Reporting http://php.net/manual/en/function.error-reporting.php

    If you do not need i to go that high (9999999999) seems really high. Reduce the size.

    Another issue you may be having is

    Fatal error:  Maximum execution time of 60 seconds exceeded
    

    You can always increase the execution time if you have to.

    Max execution time http://php.net/manual/en/function.set-time-limit.php

    also Increase max execution time for php

    Really all this depends on what error you are getting and by starting with showing the error reporting, this will help determine what the real issue at hand is.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Every programming language I know (Perl, Javascript, PHP, Python, ASP, ActionScript, Commodore Basic) uses
Is it possible to use PHP's SimpleXML functions to create an XML object from
I want to use php in console mode and create an environment to test
I'd love to use PHP variables in my CSS files but I don't want
Is there a way in PHP use a HTML form to upload only the
I use Eclipse for programming in PHP and Java(Android) and sometimes Python, unfortunately Eclipse
I've been programming PHP for a long time, but not so much PHP 5...
I've been programming in PHP for years now, but I've never learned how to
I am a complete noob in PHP and programming as well. I am very
Currently I'm programming a database class which makes a little bit use of PHP's

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.