diff --git a/ecrire/base/connect_sql.php b/ecrire/base/connect_sql.php
index a0a969faf70370584210c372f5edf967a4372d7a..85e1ecb41a7c3459bcc09aa16fc2d8a731a16c90 100644
--- a/ecrire/base/connect_sql.php
+++ b/ecrire/base/connect_sql.php
@@ -526,6 +526,7 @@ function query_reinjecte_textes($query, $textes) {
  *     - indéfini sinon.
  **/
 function spip_query($query, $serveur = '') {
+
 	$f = spip_connect_sql($GLOBALS['spip_sql_version'], 'query', $serveur, true);
 
 	return function_exists($f) ? $f($query, $serveur) : false;
diff --git a/ecrire/base/upgrade.php b/ecrire/base/upgrade.php
index d72e7e932c5990fbae4f7fb66bebc4a89f54e260..728e4773c5456b66b6ea22e5eae1bbaa98e69872 100644
--- a/ecrire/base/upgrade.php
+++ b/ecrire/base/upgrade.php
@@ -382,8 +382,7 @@ function maj_while($installee, $cible, $maj, $meta = '', $table = 'meta', $redir
 		define('_TIME_OUT', $time + _UPGRADE_TIME_OUT);
 	}
 
-	reset($maj);
-	while (list($v, ) = each($maj)) {
+	foreach ($maj as $v => $operations) {
 		// si une maj pour cette version
 		if ($v == 'init' or
 			(spip_version_compare($v, $installee, '>')
@@ -393,7 +392,7 @@ function maj_while($installee, $cible, $maj, $meta = '', $table = 'meta', $redir
 				maj_debut_page($v, $meta, $table);
 			}
 			echo "MAJ $v";
-			$etape = serie_alter($v, $maj[$v], $meta, $table, $redirect);
+			$etape = serie_alter($v, $operations, $meta, $table, $redirect);
 			$trouver_table(''); // vider le cache des descriptions de table
 			# echec sur une etape en cours ?
 			# on sort
diff --git a/ecrire/inc/charsets.php b/ecrire/inc/charsets.php
index 7ea38a64f091d3257c80d41204cea610c371918a..b32011d1ae0a70892644335cb66590b3666e6d0f 100644
--- a/ecrire/inc/charsets.php
+++ b/ecrire/inc/charsets.php
@@ -897,8 +897,11 @@ function translitteration_complexe($texte, $chiffres = false) {
 	$texte = translitteration($texte, 'AUTO', 'complexe');
 
 	if ($chiffres) {
-		$texte = preg_replace("/[aeiuoyd]['`?~.^+(-]{1,2}/eS",
-			"translitteration_chiffree('\\0')", $texte);
+		$texte = preg_replace_callback(
+			"/[aeiuoyd]['`?~.^+(-]{1,2}/S",
+			function($m) { return translitteration_chiffree($m[0]); },
+			$texte
+		);
 	}
 
 	return $texte;
diff --git a/ecrire/inc/config.php b/ecrire/inc/config.php
index 73097f413475ef116ce1ace8c190f9ddddcdcd14..a06d5d80827f67da00a203a8534da54dc3678ccc 100644
--- a/ecrire/inc/config.php
+++ b/ecrire/inc/config.php
@@ -544,8 +544,8 @@ function actualise_metas($liste_meta) {
 	// verifier le impt=non
 	sql_updateq('spip_meta', array('impt' => 'non'), sql_in('nom', $meta_serveur));
 
-	while (list($nom, $valeur) = each($liste_meta)) {
-		if (!isset($GLOBALS['meta'][$nom]) or !$GLOBALS['meta'][$nom]) {
+	foreach ($liste_meta as $nom => $valeur) {
+		if (empty($GLOBALS['meta'][$nom])) {
 			ecrire_meta($nom, $valeur);
 		}
 	}
diff --git a/ecrire/inc/plonger.php b/ecrire/inc/plonger.php
index 2ee9e97d6812ddc7c685e1b85ab83fcc0b1ae7a7..18891adca6435df57b14fefa1b9b62d88d6f06d0 100644
--- a/ecrire/inc/plonger.php
+++ b/ecrire/inc/plonger.php
@@ -57,8 +57,8 @@ function inc_plonger_dist($id_rubrique, $idom = "", $list = array(), $col = 1, $
 		$rec = generer_url_ecrire('plonger', "rac=$idom&exclus=$exclu&do=$do&col=" . ($col + 1));
 		$info = generer_url_ecrire('informer', "type=rubrique&rac=$idom&do=$do&id=");
 		$args = "'$idom',this,$col,'" . $GLOBALS['spip_lang_left'] . "','$info',event";
-		while (list($id, $titrebrut) = each($ordre)) {
 
+		foreach ($ordre as $id => $titrebrut) {
 			$titre = supprimer_numero($titrebrut);
 
 			$classe1 = $id_rubrique ? 'petite-rubrique' : "petit-secteur";
diff --git a/ecrire/install/etape_chmod.php b/ecrire/install/etape_chmod.php
index cbbbe21a9e9d6e3e56956fa519cd5bee634e9efb..870a24fc59bf02d6477e07207d9eb0f492297098 100644
--- a/ecrire/install/etape_chmod.php
+++ b/ecrire/install/etape_chmod.php
@@ -93,7 +93,7 @@ function install_etape_chmod_dist() {
 	$bad_dirs = array();
 	$absent_dirs = array();
 
-	while (list(, $my_dir) = each($GLOBALS['test_dirs'])) {
+	foreach ($GLOBALS['test_dirs'] as $i => $my_dir) {
 		$test = test_ecrire($my_dir);
 		if (!$test) {
 			$m = preg_replace(',^' . _DIR_RACINE . ',', '', $my_dir);
diff --git a/ecrire/req/sqlite_generique.php b/ecrire/req/sqlite_generique.php
index 2cd3bab68562857787407d6cc4be326e0cecc5fc..06c7176eef8aee7902be50f8ffeb5c6ad02e6f3e 100644
--- a/ecrire/req/sqlite_generique.php
+++ b/ecrire/req/sqlite_generique.php
@@ -2296,16 +2296,14 @@ function _sqlite_charger_version($version = '') {
 function _sqlite_modifier_table($table, $colonne, $opt = array(), $serveur = '') {
 
 	if (is_array($table)) {
-		reset($table);
-		list($table_origine, $table_destination) = each($table);
+		list($table_origine, $table_destination) = reset($table);
 	} else {
 		$table_origine = $table_destination = $table;
 	}
 	// ne prend actuellement qu'un changement
 	// mais pourra etre adapte pour changer plus qu'une colonne a la fois
 	if (is_array($colonne)) {
-		reset($colonne);
-		list($colonne_origine, $colonne_destination) = each($colonne);
+		list($colonne_origine, $colonne_destination) = reset($colonne);
 	} else {
 		$colonne_origine = $colonne_destination = $colonne;
 	}