Bug #55774 [Fbk->NoF]: Array index limitation

From: Date: Sun, 18 Jan 2015 04:22:20 +0000
Subject: Bug #55774 [Fbk->NoF]: Array index limitation
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-190021@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=55774&edit=1 ID: 55774 Updated by: php-bugs@lists.php.net Reported by: inge at upandforward dot com Summary: Array index limitation -Status: Feedback +Status: No Feedback Type: Bug Package: Scripting Engine problem Operating System: php 5.3.5-1ubuntu7.2 PHP Version: 5.3.8 Private report: N New Comment: No feedback was provided. The bug is being suspended because we assume that you are no longer experiencing the problem. If this is not the case and you are able to provide the information that was requested earlier, please do so and change the status of the bug back to "Re-Opened". Thank you. Previous Comments: ------------------------------------------------------------------------ [2015-01-05 21:48:59] danack@php.net Hi Inge, It does mean that there is something different between your local server and the expected behaviour. If this is still occuring, please can you provide some information about what the difference is between your local server and webserver. ------------------------------------------------------------------------ [2011-09-25 09:05:28] inge at upandforward dot com The original code, using "basename", only fails on my local server, NOT when executed on my webhost. That should conclude that this is not a PHP bug? ------------------------------------------------------------------------ [2011-09-25 09:00:50] inge at upandforward dot com For now I have made a work-around which works in all cases, using this function: function name_only($file) { $from[] = '.'.substr(strrchr($file,'.'),1); $from[] = dirname($file).'/'; // Remove extension and path. return str_replace ($from,'',$file); } ------------------------------------------------------------------------ [2011-09-25 08:37:08] inge at upandforward dot com I think I have found the problem, but no solution. The following test script functions perfectly when run stand-alone, but "basename" fails when run from Apache 2.0. Are you able to reproduce the error? <?php define ('PT' , '.'); // (Decimal) point define ('LF' , PHP_EOL); // File newline $charset = 'utf-8'; // NB! Select charset here! define ('CHARSET',$charset); // NB! Define it as a constant. setlocale(LC_ALL, 'nb_NO'); mb_internal_encoding (CHARSET); putenv ("LANG=nb_NO.".CHARSET); $filenames = array ("php/Treffer.php","php/Øvinger.php","php/Æsop.php"); $destinations = array(); // Save all info for each file. This means that we won't have to foreach ($filenames as $file) // search any more. { $key = basename($file,".php"); $destinations[$key] = $file; } echo "After: ".print_r($destinations); ?> ------------------------------------------------------------------------ [2011-09-25 07:41:06] inge at upandforward dot com You are right. This was a case of jumping to conclusions. The value used as a key was already wrong, and I should have checked that. The problem is associated with the function basename, but I have also not been able to reproduce this in a standalone script, so it must be a side-effect from something else. I need to investigate further. Sorry to have bothered you. I really thought I had done enough testing! :) ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=55774 -- Edit this bug report at https://bugs.php.net/bug.php?id=55774&edit=1

« previous php.bugs (#190021) next »