|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2019-02-28 10:18 UTC] nikic@php.net
-Status: Open
+Status: Feedback
[2019-02-28 10:18 UTC] nikic@php.net
[2019-03-01 15:47 UTC] dantaeusb at live dot com
[2019-03-01 15:50 UTC] dantaeusb at live dot com
-Status: Feedback
+Status: Open
-Package: Arrays related
+Package: Xdebug
[2019-03-01 15:50 UTC] dantaeusb at live dot com
[2020-01-20 17:14 UTC] derick@php.net
-Status: Open
+Status: Wont fix
[2020-01-20 17:14 UTC] derick@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 02 19:00:02 2025 UTC |
Description: ------------ Under some circumstances, the following code (shortened, see link below for more info): $selects = array(); foreach (array_keys($this->getAttributesByTable()) as $table) { echo gettype($selects); var_dump($selects); echo gettype($selects[$eavType]); $selects[$eavType][] = $this->_addLoadAttributesSelectFields($select, $table, $eavType); } Got executed with the following result: array .../Abstract.php:992: array (size=0) empty string ( ! ) Fatal error: Uncaught Error: [] operator not supported for strings in .../Abstract.php on line 995 As you can see, it seems like for some reason type of value in an empty array got recognized like a string. I checked a lot of options and asked for community help but as far nobody could answer why is that happening, so I decided to make a bug report. Unfortunately, this happens very rarely under some unknown circumstances, so I can't make test script or make a gdb backtrace using CLI. If you can help me and explain how to grab some more useful data about scope or execution environment Here's the extended discussion with more info: https://stackoverflow.com/questions/54913287/under-some-circumstances-operator-not-supported-for-strings-error-occurs-whe Reproduced on both local (7.2.15, Ubuntu 16.04 x64), dev and production (7.2.15 RHEL 6) environments. Don't think It's related to environment or some modules, but here's the list of installed modules (tried to pick only additionally installed modules). [PHP Modules] ... gd ... iconv igbinary imagick ... mbstring mcrypt mysqli mysqlnd openssl pcntl pcre PDO pdo_mysql Phar posix readline redis Reflection session shmop SimpleXML sockets sodium SPL ... xdebug xml ... Zend OPcache zip zlib [Zend Modules] Xdebug Zend OPcache Excuse me for possible grammar errors and thanks in advance.