Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

each deprecated in php 7.2 #359

Open
jipexu opened this issue Oct 9, 2018 · 9 comments

Comments

@jipexu
Copy link
Member

commented Oct 9, 2018

il semble qu'on l'utilise plus de 100 fois ....
==> donc encore du boulot en perspective :

à réécrire avec des foreach .....
pas dramatique pour l'instant mais l'abandon (donc erreur fatale) devrait suivre rapidement dans les prochaine version de php ...

.... j'en ai déjà corrigé quelques uns mais à chaque fois il faut vraiment re-tester

@jipexu jipexu added the 🐘 php core label Oct 9, 2018
@jipexu jipexu self-assigned this Oct 9, 2018
@jipexu

This comment has been minimized.

Copy link
Member Author

commented Oct 9, 2018

admin/automated.php:80:    while (list($groupe_id, $groupe_name)=each($mX)) {
admin/blocks.php:29:    while (list($groupe_id, $groupe_name)=each($mX)) {
admin/download.php:29:    while (list($groupe_id, $groupe_name)=each($mX)) {
admin/groupes.php:128:       while (list($bidon,$gp)=each($tab_groupeIII)) {
admin/groupes.php:152:          while (list($bidon,$uidX)=each($tab_groupe)) {
admin/groupes.php:265:          while (list($bidon,$gpU)=each($tab_groupeIII)) {
admin/groupes.php:414:    while (list($bidon,$uidZ)=each($tab_groupe)) {
admin/groupes.php:540:    while (list($n,$ligne) = each($file)) {
admin/groupes.php:563:    while (list ($key, $file) = each ($filelist)) {
admin/groupes.php:578:    while (list ($key, $file) = each ($filelist)) {
admin/groupes.php:729:    while (list ($key, $file) = each ($filelist)) {
admin/lnl.php:394:       while (list($groupe_id, $groupe_name)=each($mX)) {
admin/lnl.php:703:                $fonction="each";
admin/phpbbmaint.php:155:        while (list($topic_id,$value)=each($topics)) {
admin/savemysql.php:65:       while(list($x, $columns) = @each($index))
admin/sections.php:26:    while (list($groupe_id, $groupe_name)=each($mX)) {
admin/settings_save.php:17:       while($line = each($temp)) {
admin/stories.php:76:     while (list($groupe_id, $groupe_name)=each($mX)) {
admin/users.php:170:       while (list ($key, $file) = each ($filelist)) {

auth.php:19:    list(,$myrow) = each($rowQ1);
auth.php:41:       list(,$myrow) = each($rowQ1);
auth.php:50:       list(,$myrow) = each($rowQ1);
auth.php:59:          list(,$myrow) = each($rowQ1);
autodoc.php:63:    while ( list($line_num, $line)=each($fcontents) ) {
banners.php:46:       list(,$myrow)=each($rowQ1);
editpost.php:29: list(,$myrow) = each($rowQ1);
functions.php:33:    while(list(,$poster_id) = each($rowQ1)) {
functions.php:133:    while(list(,$uname) = each($rowQ1)) {
functions.php:432:    while (list ($key, $file) = each ($filelist)) {
functions.php:713:    while (list(,$row0)=each($rowQ0)) {
functions.php:718:       while (list(,$row) = each($rowQ1)) {
functions.php:722:             while(list(,$myrow) = each($rowQ2)) {
grab_globals.php:108:        while($uri_content=each($bad_uri_content)) {
grab_globals.php:182:        while (list($key,$value)=each($_FILES)) {
grab_globals.php:186:        while (list($key,$value)=each($HTTP_POST_FILES)) {
install/libraries/lib-inc.php:25:    while(list($n,$ligne) = each($file)) {
install/libraries/lib-inc.php:109:       while(list($n,$ligne) = each($file)) {
install/libraries/lib-inc.php:138:       while(list($n,$ligne) = each($file)) {
install/libraries/lib-inc.php:219:       while(list($n,$ligne) = each($file)) {
install.php:64:       while(list($n,$ligne) = each($file)) {
lib/feedcreator.class.php:949:       while( list(, $line) = each($lines) ) {
mainfile.php:818:    list(,$NumG)=each($row_Q2);
mainfile.php:847:    while(list(,$myrow) = each($result)) {
mainfile.php:975:       list(,$groupe) = each($user_temp);
mainfile.php:1117:          while(list($id,$class)=each($tmp)) {
mainfile.php:1140:          while (list(,$RR_uri)=each($tab_uri)) {
mainfile.php:1145:                while (list($idx,$RRR_uri)=each($tab_puri)) {
mainfile.php:1567:    while (list($bidon, $lang)=each($tab_llangue)) {
mainfile.php:1623:    while (list($bidon, $langue)=each($tab_langue)) {
mainfile.php:1835:    while(list(,$bidon)=each($tmp)) {
mainfile.php:1974:       while (list ($key, $val) = each ($tab_spam)) {
mainfile.php:2151:       list(,$uid) = each($result);
mainfile.php:2318:       list(,$ublock) = each($getblock);
mainfile.php:2717:             while (list(,$userlevel)=each($tmp_auto)) {
mainfile.php:3056:    while (list(,$ar_data)=each($res)) {
memberslist.php:38:    while (list(, $ltr) = each($alphabet)) {
memberslist.php:59:    while (list(,$to_user) = each($ibid)) {
minisite.php:307:                while (list($g_id, $g_name)=each($gX)) {
modules/archive-stories/archive-stories.php:48:          list(,$count)=each($result0);
modules/cluster-paradise/cluster-E.php:21:       while (each($part) and !$trouve) {
modules/cluster-paradise/cluster-M.php:19:       while (each($part)) {
modules/cluster-paradise/cluster-M.php:59:       while (each($tmp)) {
modules/f-manager/class.navigator.php:224:      while (list($key, $val) = each($this->DirsList["DateM"])) {
modules/f-manager/f-manager.php:102:                while (list(,$gp)=each($tab_auto)) {
modules/f-manager/f-manager.php:186:             while (list(,$gp)=each($tab_groupe)) {
modules/f-manager/f-manager.php:529:                   while (list(,$rep)=each($arb)) {
modules/f-manager/f-manager.php:806:          while($fic_resp=each($resp)) {
modules/f-manager/f-manager.php:932:          while (list($l,$fic_resp)=each($tab_search)) {
modules/f-manager/f-manager.php:969:             while ( (list($l,$fic_resp)=each($tab_search)) and (!$ico_search)) {
modules/f-manager/pic-manager.php:96:                while (list(,$gp)=each($tab_auto)) {
modules/geoloc/admin/geoloc_set.php:55:    while (list($k, $v) = each($ar_fields)) {
modules/geoloc/admin/geoloc_set.php:89:    while (list($ke, $va) = each($dispofield)) {
modules/geoloc/admin/geoloc_set.php:103:    while (list($ke, $va) = each($dispofield)) {
modules/meta-lang/adv-meta_lang.php:65:    while (list(,$RR_uri)=each($tab_uri)) {
modules/meta-lang/adv-meta_lang.php:155:    while ($word=each($text)) {

modules/sform/extend-user/adm_formulaire.php:97:    while (list($groupe_id, $groupe_name)=each($mX)) {
modules/sform/extend-user/extender/formulaire.php:77: while (list($k, $v) = each($fieldrest)) {
modules/sform/extend-user/formulaire.php:35:    while (list ($key, $file) = each ($filelist)) {
modules/sform/extend-user/mod_formulaire.php:66:       while (list ($key, $file) = each ($filelist)) {
modules/sform/sform.php:56:     while(list($key,$val)=each($ibid0) ){
modules/sform/sform.php:460:           while(list($key,$val)=each($this->form_fields[$i]['value']) ){
modules/sform/sform.php:483:          while(list($key,$val)=each($this->form_fields[$i]['value']) ){
modules/sform/sform.php:1072:            while (list($num,$line)=each($ibid)) {
modules/upload/!!include!!/fileupload.php:267:          while ( list (,$goodext) = each($allowed_extensions) ) {
modules/upload/!!include!!/fileupload.php:285:          while ( list (,$badext) = each($banned_extensions) ) {
modules/upload/!!include!!/fileupload.php:304:          while ( list (,$mt) = each($allowed_mimetypes) ) {
modules/upload/!!include!!/fileupload.php:325:          while ( list (,$mt) = each($banned_mimetypes) ) {
modules/upload/!!include!!_forum/upload.func.forum.php:75:       while (list($k, $v) = each($items)) {
modules/upload/!!include!!_forum/upload.func.forum.php:305:    while (list(, $thisline) = each($t_lines)) {
modules/upload/!!include!!_forum/upload.func.forum.php:309:          while (list(, $thisword) = each($t_l_lines)) {
modules/upload/!!include!!_forum/upload.func.forum.php:371:       while (list($id, $mode) = each($inline_att)) {
newtopic.php:35: list(,$myrow) = each($rowQ1);
powerpack_f.php:192:              list(,$myrow) = each($rowQ1);
powerpack_f.php:198:                       list(,$myrow) = each($rowQ2);
powerpack_f.php:309:             list(,$autovalueX) = each ($result);
powerpack_f.php:410:                  list(,$myrow) = each($RowQ1);
powerpack.php:31:             list(,$uid)=each($rowQ1);
prntopic.php:30: list(,$myrow) = each($rowQ1);
prntopic.php:36: list(,$myrow) = each($rowQ1);
reply.php:34: list(,$myrow) = each($rowQ1);
replyH.php:34: list(,$myrow) = each($rowQ1);
replypmsg.php:78:          while (list(,$to_user) = each($tempo)) {
search.php:345:             list(,$row2) = each($rowQ2);
search.php:347:             list(,$row3) = each($rowQ3);
searchbb.php:35:    while (list(,$row) = each($rowQ1)) {
searchbb.php:92:    while (list(,$row) = each($rowQ1)) {
sections.php:20:    while (list(,$userlevel)=each($tmp_auto)) {
sections.php:242:    while (list(,$userlevel)=each($tmp_auto)) {
sitemap.php:111:    while (list($name,$loc)= each($PAGES)) {
topicadmin.php:52:    list(,$myrow) = each($rowQ1);
viewforum.php:67: list(,$myrow) = each($rowQ1);
viewtopic.php:52: list(,$myrow) = each($rowQ1);
viewtopic.php:57: list(,$myrow) = each($rowQ1);
viewtopicH.php:32: list(,$myrow) = each($rowQ1);
viewtopicH.php:38: list(,$myrow) = each($rowQ1);
viewtopicH.php:111:    while(list($key,$val)=each($list)) {
@Jireck-npds

This comment has been minimized.

Copy link
Contributor

commented Oct 10, 2018

A remplacer par foreach + dans certains cas unset...
Pas mal de boulot effectivement

@stale

This comment has been minimized.

Copy link

commented Dec 10, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Dec 10, 2018
@stale stale bot closed this Dec 17, 2018
@jipexu jipexu reopened this Jan 11, 2019
@stale stale bot removed the wontfix label Jan 11, 2019
@stale

This comment has been minimized.

Copy link

commented Mar 12, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Mar 12, 2019
@stale stale bot closed this Mar 19, 2019
@Jireck-npds

This comment has been minimized.

Copy link
Contributor

commented Apr 5, 2019

@jipexu

This comment has been minimized.

Copy link
Member Author

commented Sep 12, 2019

ces corrections seront dans la prochaine release ....

@jipexu jipexu reopened this Sep 12, 2019
@stale stale bot removed the wontfix label Sep 12, 2019
@Jireck-npds

This comment has been minimized.

Copy link
Contributor

commented Sep 18, 2019

Juste comme ca mais je te fais confiance,
le remplacement de
while (list($key,$value)=each($_FILES)) {
par
foreach ($_FILES as $key => $value) {
n'est pas pareil si il y a un traitement dans la boucle par les valeurs et hors boucle ensuite...
mais je pense que tu as tester

@jipexu

This comment has been minimized.

Copy link
Member Author

commented Sep 18, 2019

oui comme dans toutes les boucles ? non ?
oui il y a vraiment beaucoup de contextes différents de l'utilisation de ce each ... (en fonction du traitement des variables) et des utilisation en boucle ou pas, du type de array parcouru, de l'utilisation des clef ou pas etc etc ... Je n'ai pas fait des remplacement automatique mais étudié au cas par cas ... On test tout mais il est possible que par inattention ou manque d'analyse on ai induit des dysfonctionnements ... ces modifs nécessiteront de l'attention et des tests ...

il me reste quelque cas un peu tordu et c'est presque fini y compris dans les modules ...

après on affinera en fonction des retours

@Jireck-npds

This comment has been minimized.

Copy link
Contributor

commented Sep 20, 2019

Perfect si tu as vu cas par cas !
rien a dire.... parfait !
Good JoB @jipexu

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
REvolution 16.0
Awaiting triage
2 participants
You can’t perform that action at this time.