Categories > Your tips & tricks >

Knowed bugs

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Skrol29
Date: 2005-12-15
Time: 16:28

Knowed bugs

Hello, in this thread I will post some knowed bugs or problems about TBS.

Pleas don't post any question directly in this thread. Use other forum instead.
By: Skrol29
Date: 2005-12-15
Time: 16:29

problems with PHP 4.4.1

A bad PHP bug which appears with Php 4.4.1,  and disappeared with Php 4.4.2-dev, makes troubles with Array pointers.

This bug makes array functions key() and current() to return bad values when used on a variable with several references.
Reference to the bug:
  http://bugs.php.net/bug.php?id=35084

Since this bug has no easy workaround and is already fixed in the next Php Dev version, we just recommend to not use PHP 4.4.1 for any of you applications.

This bug has a big impact on TinyButStrong because Array pointers are used to merge Array data and also to merge several blocks with the same data source.
But you have to take car that this bug will probably have several impacts on other PHP libraries.


Here is a snipet which put the bug in evidence:
$ar = array('one','two','tree');
$ar2 =& $ar;

reset($ar);
$key = key($ar);
echo " key={".$key."}, val={".$ar[$key]."} <br>";

next($ar);
$key = key($ar);
echo " key={".$key."}, val={".$ar[$key]."} <br>";

Expected result:
key={0}, val={one}
key={1}, val={two}

Result with PHP 4.1.1 :
key={0}, val={one}
key={0}, val={one}