1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

Code golf: How to fix all bugs?

Discussion in 'Off-Topic' started by SOFe, Feb 24, 2018.

  1. SOFe

    SOFe Administrator Staff Member PMMP Team Poggit Admin

    Messages:
    1,968
    GitHub:
    sof3
    Write code to suggest innovative or boring ways to fix most if not all bugs you can find on your server below.
     
  2. SOFe

    SOFe Administrator Staff Member PMMP Team Poggit Admin

    Messages:
    1,968
    GitHub:
    sof3
    A few examples:

    Exit with 0 as soon as possible.
    This will make your server exit with code 0, i.e. the program completed without error.
    PHP:
    exit(0);
    Suppress error logging
    Since users usually upload a crash dump without explaining what's wrong in their issues, we can assume that the root of all bugs is crash dumps.
    PHP:
    ob_start(function($lines){
      return 
    implode("\n"array_filter(explode("\n"$lines), function($line){
        return 
    stripos($line"error") === false;
      }));
    });
     
    dktapps likes this.
  3. dktapps

    dktapps Administrator Staff Member PMMP Team

    Messages:
    774
    GitHub:
    dktapps
    Code:
    php -r '@require "src/pocketmine/PocketMine.php";'
    
     
    SOFe likes this.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.