The PHP 4.3.10 foreach function seems to have changed (probably not intentionally, the ChangeLog is speaking of "optimizations" backported from PHP 5). $array = ( 0 => 'A', 1 => 'B' ); foreach($array as $bla) print_r($bla); returns Array(0 => 'A', 1 => 0) Array(0 => 'B', 1 => 1) instead of 'A' 'B' This breaks pear (just try to run /usr/bin/pear) and TikiWiki, etc... Reproducible: Always Steps to Reproduce: 1. emerge php 2. run pear 3. watch the error messages
I assume you meant this as your test code: ------ $array = array( '0' => 'A', '1' => 'B' ); foreach($array as $bla) print_r($bla); ------ And I do get the correct output of 'AB' on my x86 test box.
Could you please force the unpack+compile+package stages of the ebuild, then go into $S and run the PHP testcases?
Just recompiled. Same phenomenon. The test doesn't even begin. websrv:/var/tmp/portage/php-4.3.10/work/php-4.3.10 # make test Notice: Array to string conversion in /var/tmp/portage/php-4.3.10/work/php-4.3.10/run-tests.php on line 851 [repeated about 15 times] ===================================================================== CWD : /var/tmp/portage/php-4.3.10/work/php-4.3.10 PHP : /var/tmp/portage/php-4.3.10/work/php-4.3.10/sapi/cli/php PHP_SAPI : cli PHP_VERSION : 4.3.10 ZEND_VERSION: 1.3.0 PHP_OS : Linux - Linux websrv 2.6.10-rc3-cs1 #1 Tue Dec 14 02:57:14 CET 2004 i686 INI actual : /etc/php/cli-php4/php.ini More .INIs : Extra dirs : ===================================================================== Warning: opendir(/var/tmp/portage/php-4.3.10/work/php-4.3.10/Array): failed to open dir: No such file or directory in /var/tmp/portage/php-4.3.10/work/php-4.3.10/run-tests.php on line 238 ERROR: cannot open directory: /var/tmp/portage/php-4.3.10/work/php-4.3.10/Array make: [test] Error 1 (ignored)
Ok, sorry. When I disable the Zend Optimizer the problem goes away. I looks like I need a newer version. Sorry again.