BrainCMS [PHP, From Scratch]

Page 2 of 2 FirstFirst 12
Results 16 to 21 of 21
  1. #16
    Account Upgraded | Title Enabled! Tony is offline
    MemberRank
    Feb 2011 Join Date
    349Posts

    Re: BrainCMS [PHP, From Scratch]

    Show me some also Rob downloading JDK atm.

  2. #17
    "(still lacks brains)" NoBrain is offline
    MemberRank
    Sep 2011 Join Date
    United KingdomLocation
    2,658Posts

    Re: BrainCMS [PHP, From Scratch]

    If anyone would like the previous versions of BrainCMS...

    v1.0.3: Brain.rar | localhostr.com - share … anything
    v1.0.2: Brain.rar | localhostr.com - share … anything

  3. #18
    CloudCMS Developer blackpol is offline
    MemberRank
    Aug 2006 Join Date
    The NetherlandsLocation
    232Posts

    Re: BrainCMS [PHP, From Scratch]

    Quote Originally Posted by Jupos View Post
    A variable will run at exactly the same speed rather than putting the data in automatically.
    See it yourself if you wont believe...
    A constant use almost 2 times the memory of a variable...

    PHP Code:
    <?php
    /* Define functions */

    function timer_start() {
        global 
    $timestart;
        
    $mtime microtime();
        
    $mtime explode(' ',$mtime);
        
    $mtime $mtime[1] + $mtime[0];
        
    $timestart $mtime;
        return 
    true;
    }

    function 
    timer_stop($display 0$precision 3) {
        global 
    $timestart$timeend;
        
    $mtime microtime();
        
    $mtime explode(' ',$mtime);
        
    $mtime $mtime[1] + $mtime[0];
        
    $timeend $mtime;
        
    $timetotal $timeend-$timestart;
        if (
    $display)
            echo 
    number_format($timetotal,$precision);
        return 
    $timetotal;
    }

    function 
    testvar($loop) {
        global 
    $val0,$val1,$val2,$val3,$val4,$val5,$val6,$val7,$val8;
        for (
    $i=0;$i<$loop;$i++) {
            
    $test = ((sin($val0 $val1 $val2))/$val6 * (sqrtlog($val3) * abs($val4 1/$val5)) / $val7)) * $val8;
        }
    }

    function 
    testarr($loop) {
        global 
    $arrayval;
        for (
    $i=0;$i<$loop;$i++) {
            
    $test = ((sin($arrayval[0] * $arrayval[1] + $arrayval[2]))/$arrayval[6] * (sqrtlog($arrayval[3]) * abs($arrayval[4] - 1/$arrayval[5])) / $arrayval[7])) * $arrayval[8];
        }
    }

    function 
    testconst($loop) {
        for (
    $i=0;$i<$loop;$i++) {
            
    $test = ((sin(VAL0 VAL1 VAL2))/VAL6 * (sqrtlog(VAL3) * abs(VAL4 1/VAL5)) / VAL7)) * VAL8;
        }
    }

    /* Define variables, arrays and constants */

    $loop 10000;

    $val0 11;
    $val1 33.5;
    $val2 0.333333333333;
    $val3 4569988.2;
    $val4 159;
    $val5 2.33333333333;
    $val6 = -10;
    $val7 = -6.6;
    $val8 = -1245487545;

    define('VAL0',11);
    define('VAL1',33.5);
    define('VAL2',0.333333333333);
    define('VAL3',4569988.2);
    define('VAL4',159);
    define('VAL5',2.33333333333);
    define('VAL6',-10);
    define('VAL7',-6.6);
    define('VAL8',-1245487545);

    $arrayval[0]=11;
    $arrayval[1]=33.5;
    $arrayval[2]=0.333333333333;
    $arrayval[3]=4569988.2;
    $arrayval[4]=159;
    $arrayval[5]=2.33333333333;
    $arrayval[6]=-10;
    $arrayval[7]=-6.6;
    $arrayval[8]=-1245487545;

    /* Let's run a few tests now */

    echo 'test with PHP '.phpversion();
    echo 
    "<hr>\n";

    /**
     * Straight Tests
     */

    echo '<h1>lots of vars</h1>';

    timer_start();
    for(
    $i=0;$i<$loop;$i++) {
        
    $test = ((sin($val0 $val1 $val2))/$val6 * (sqrtlog($val3) * abs($val4 1/$val5)) / $val7)) * $val8;
    }
    echo 
    'straight, variables : ';timer_stop(1,9);
    echo 
    "<hr>\n";


    timer_start();
    for(
    $i=0;$i<$loop;$i++) {
        
    $test = ((sin($arrayval[0] * $arrayval[1] + $arrayval[2]))/$arrayval[6] * (sqrtlog($arrayval[3]) * abs($arrayval[4] - 1/$arrayval[5])) / $arrayval[7])) * $arrayval[8];
    }
    echo 
    'straight, array: ';timer_stop(1,9);
    echo 
    "<hr>\n";


    timer_start();
    for(
    $i=0;$i<$loop;$i++) {
        
    $test = ((sin(VAL0 VAL1 VAL2))/VAL6 * (sqrtlog(VAL3) * abs(VAL4 1/VAL5)) / VAL7)) * VAL8;
    }
    echo 
    'straight, constants: ';timer_stop(1,9);
    echo 
    "<hr>\n";

    /**
     * Function call and a global statement
     */

    echo '<h1>function(lots of vars)</h1>';

    timer_start();
    testvar($loop);
    echo 
    'function call, variables: ';timer_stop(1,9);
    echo 
    "<hr>\n";

    timer_start();
    testarr($loop);
    echo 
    'function call, array: ';timer_stop(1,9);
    echo 
    "<hr>\n";


    timer_start();
    testconst($loop);
    echo 
    'function call, constants: ';timer_stop(1,9);
    echo 
    "<hr>\n";

    ?>
    Last edited by blackpol; 25-09-11 at 01:40 PM.

  4. #19
    sexiess is a sin. Subway is offline
    MemberRank
    Jun 2010 Join Date
    2,491Posts

    Re: BrainCMS [PHP, From Scratch]

    Where's pick of CMS?

  5. #20
    "(still lacks brains)" NoBrain is offline
    MemberRank
    Sep 2011 Join Date
    United KingdomLocation
    2,658Posts
    Quote Originally Posted by Subway View Post
    Where's pick of CMS?
    Wtf you on about?
    Posted via Mobile Device

  6. #21
    "(still lacks brains)" NoBrain is offline
    MemberRank
    Sep 2011 Join Date
    United KingdomLocation
    2,658Posts

    Re: BrainCMS [PHP, From Scratch]

    Here is the brand new design(unfinished)



    Oh shit, just noticed I double posted...



Page 2 of 2 FirstFirst 12

Advertisement