Jump to content

eric1235711

Members
  • Posts

    107
  • Joined

  • Last visited

    Never

Everything posted by eric1235711

  1. I´d like to know if php reads all the defines I´ve declared and builds a table with the constants... If I make ten files with a hundred defines in each, php will build a table with a thousand constants?
  2. i need to do me thing like this? [code] <?php define('TEST', 'test is' . ($test? ' ': ' not ') . 'ok'); echo TEST; ?> [/code]
  3. This works? [code] <?php if ($test)   define('TEST', 'test is ok'); else   define('TEST', 'test is not ok'); echo TEST; ?> [/code] of course I will not do some like it, but I just want to know if using define inside a 'if' clause works... ???
  4. I didn´t find any good chat to download... but I´ve got an idea... [without flash an without ajax] but I don´t know if it´s good... What about the frame where the messages appear do not refresh, keepping it in a endless loop consulting a database and flushing data? Ops, I just remebered that flushing just works with a great amount of data... in a chat it won´t work very nicely... I got another idea... what about an invisible iframe that keeps reloading, looking for new messages with hight frequency? or a inteligent/calculated frequency? I saw many that keeps reloading in same frequency... Ouch... I just remembered a detail.... and if the frame refresh just when is scrolling, reading old messagens? wow... that´s not so easy than I was thinking...
  5. I saw a lot of functions using str_replace like: [code] <?php function cleanA($str){    $Aarray= array('À','Â','Á','Ã','Ä','Å');    $str = str_replace($Aarray,'A',$str);       $aarray = array('à','á','â','ã','ä','å');    $str = str_replace($Aarray,'a',$str);    return $str; } ?> [/code]
  6. I´m testing the capacity of php with recursive functions and objects... I made them endless to know the limits. My doubts are: 1. 872 levels is the limit of php or of my memory? 2. Is there any settings to increase this number of levels? 3. Is there any settings to "recurse" til execution time limit is reached?
  7. that foreach will not work: it must be something like foreach($my_arr as $my_key => $my_value) or foreach($my_arr as $my_value) and inside the foreach loop, all the results will be overwriten and that final IF will check only the numrows of the last query. diy XP
  8. Hello, I´m doing some tests... and look this one: [code] <?php class Test{     var $vari;     var $subclass;     // constructor     function Test($qt){         $this->vari = "$qt";         echo $qt.' ';     $qt ++;     $this->subclass = new Test($qt);     } } $qt = 0; $objeto = new Teste($qt); ?> [/code] Here it ran 872 levels and php just stopped, returning no errors... do you know what happened? I just ran this one: [code] function test2($qt){     echo "$qt ";     flush();     if($qtd < 10000)         return test2(++$qtd);     else         return 'end'; } echo test2(0); [/code] and the error was the same: 872 levels of recursion and no error message... I´m asking this because I'm going to do a work that uses recursion. Do you find that it´s better to use another language? Don´t you find that php should run them while execution time limit haven´t been reached?
×
×
  • 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.