pdo_ibm/tests/fvt.inc - replace eregi() with preg_match()

From: Date: Wed, 29 Dec 2010 07:23:20 +0000
Subject: pdo_ibm/tests/fvt.inc - replace eregi() with preg_match()
Groups: php.qa 
Request: Send a blank email to php-qa+get-65718@lists.php.net to get a copy of this message
Hi, pdo_ibm/tests/fvt.inc seems to still use the deprecated eregi() function. Suggest to replace it with preg_match() as in : Index: fvt.inc ===================================================================
--- fvt.inc    (revision 306810)
+++ fvt.inc    (working copy)
@@ -106,8 +106,8 @@
                     $rel = "V5";
                 }
                 // PASE test_xxx_V5V6.phpt
-                if (eregi("V6|V5", $_SERVER["PHP_SELF"])) {
-                    if (!eregi($rel, $_SERVER["PHP_SELF"])) {
+                if (preg_match('/V5|V6/i', $_SERVER["PHP_SELF"])) {
+                    if (!preg_match("/$rel/i", $_SERVER["PHP_SELF"])) {
                         die('skip');
                     }
                 }
@@ -126,10 +126,10 @@
                 }
             }
             else {
-                if (eregi("V5|V6", $_SERVER["PHP_SELF"])) die('skip');
+                if (preg_match('/V5|V6/i', $_SERVER["PHP_SELF"])) die('skip');
             }
         } catch (PDOException $pe) {
-            if (eregi("V5|V6", $_SERVER["PHP_SELF"])) die('skip');
+            if (preg_match('/V5|V6/i', $_SERVER["PHP_SELF"])) die('skip');
         }
     }
} (don't have the karma to commit a pecl test change myself). thx, Eyal

« previous php.qa (#65718) next »