View Issue Details

IDProjectCategoryView StatusLast Update
12992Bug reports[All Projects] Otherpublic2017-12-06 09:51
Reporteralex2kAssigned To 
PrioritynoneSeverityminor 
Status newResolutionopen 
Product Version2.7x.x 
Target VersionFixed in Version 
Summary12992: PHP-function each() has been deprecated
DescriptionThe PHP-function each() has been deprecated as of PHP 7.2.0 (https://wiki.php.net/rfc/deprecations_php_7_2#each), but is still used in Limesurvey:

application/views/admin/survey/printablesurvey_view.php: while (list ($key, $val) = each($survey_output))
application/views/admin/quotas/newanswertwo_view.php: while (list($key,$value) = each($question_answers))
application/helpers/Zend/XmlRpc/Value.php: list($type, $value) = each($xml);
application/helpers/Zend/XmlRpc/Value.php: list($type, $value) = each($namespaceXml);
application/third_party/pear/PEAR.php: while (list($k, $objref) = each($_PEAR_destructor_object_list)) {
application/third_party/phpmailer/extras/htmlfilter.php: while (list($attname, $attvalue) = each($attary)) {
application/third_party/phpmailer/extras/htmlfilter.php: while (list($attname, $attvalue) = each($attary)) {
application/third_party/tcpdf/tcpdf.php: while (list($key, $val) = each($prop)) {
application/third_party/tcpdf/tcpdf.php: while (list($id, $name) = each($attr_array[1])) {
application/third_party/tcpdf/tcpdf.php: while (list($id, $name) = each($style_array[1])) {
application/controllers/admin/quotas.php: while (list($key, $value) = each($slangs))
application/controllers/admin/questiongroups.php: while (list($key, $value) = each($grplangs))
application/controllers/admin/questions.php: while (list($key, $value) = each($questlangs))

framework/gii/components/Pear/Text/Diff/Engine/native.php: while (list(, $y) = each($matches)) {
framework/gii/components/Pear/Text/Diff/Engine/native.php: while (list(, $y) = each($matches)) {
framework/web/widgets/CTabView.php: list($this->activeTab, )=each($this->tabs);

third_party/kcfinder/lib/class_image.php: list($key, $width) = each($image);
third_party/kcfinder/lib/class_image.php: list($key, $height) = each($image);

So each() should be replaced by foreach() which is also 10 times faster or key()/current()/next().
TagsNo tags attached.
Complete LimeSurvey version number (& build)2.72.5+171121
I will donate to the project if issue is resolvedNo
Browser
Database & DB-VersionMariaDB 10.2
Operating System (Server)RHEL 7
Webserver software & versionApache 2.4
PHP Version7.2.0

Activities

There are no notes attached to this issue.

Issue History

Date Modified Username Field Change
2017-12-06 09:51 alex2k New Issue