<NME> travis.sh
<BEF> #!/bin/bash

export PYTHONPATH=$PYTHONPATH:pypy


declare -a STEPS=(
    'py.test testing/ -v'
    'python pypy/rpython/bin/rpython targethippy.py'
);

if [[ "$TRANSLATE" == "true" ]]; then
    python pypy/rpython/bin/rpython targethippy.py
else
    py.test "$TESTDIR" -v
fi

<MSG> Merge branch 'master' of github.com:hippyvm/hippyvm

Conflicts:
	hippy/bytecode_cache.py

<DFF> @@ -2,14 +2,8 @@
 
 export PYTHONPATH=$PYTHONPATH:pypy
 
-
-declare -a STEPS=(
-    'py.test testing/ -v'
-    'python pypy/rpython/bin/rpython targethippy.py'
-);
-
 if [[ "$TRANSLATE" == "true" ]]; then
-    python pypy/rpython/bin/rpython targethippy.py
+    python pypy/rpython/bin/rpython --batch targethippy.py
 else
-    py.test "$TESTDIR" -v
+    eval "py.test $TESTDIR -v"
 fi

{'commit': 'diff --git a/.gitignore b/.gitignore\nindex 25edd976..6aebc818 100644\n--- a/.gitignore\n+++ b/.gitignore\n@@ -15,3 +15,4 @@ pypy/\n \n ext_module\n testing/ext-module\n+hippy/lexer_cache/runner_*.py\ndiff --git a/.travis.yml b/.travis.yml\nindex 79e7e7be..a64937e9 100644\n--- a/.travis.yml\n+++ b/.travis.yml\n@@ -6,7 +6,9 @@ cache: apt\n env:\n   - TRANSLATE=true\n   - TESTDIR=testing/\n-  - TESTDIR=test_phpt/\n+  - TESTDIR=test_phpt/[^e]*/\n+  - TESTDIR="test_phpt/ext/ -k \'not standard\'"\n+  - TESTDIR=test_phpt/ext/standard/\n \n before_install:\n   - sudo apt-get update -qq\n@@ -15,6 +17,8 @@ before_install:\n   - sudo apt-get install -y librhash-dev\n   - sudo apt-get install -y libbz2-dev\n   - sudo apt-get install -y php5-cli\n+  # Some locale tests require fr_FR.ISO-8859-1\n+  - sudo apt-get install -y language-pack-fr\n \n install:\n   - wget https://bitbucket.org/pypy/pypy/get/default.tar.gz\n@@ -24,11 +28,6 @@ install:\n script:\n   - ./travis.sh\n \n-matrix:\n-  fast_finish: true\n-  allow_failures:\n-    - env: TESTDIR=test_phpt/\n-\n notifications:\n   irc:\n     channels: "irc.freenode.org#hippyvm"\ndiff --git a/AUTHORS b/AUTHORS\nindex 6fc02c4d..03ce8e41 100644\n--- a/AUTHORS\n+++ b/AUTHORS\n@@ -9,6 +9,8 @@ Sebastian Pawluś\n Ashwini Oruganti\n Edd Barrett\n \n+Sebastian Kreft\n+Deezer (www.deezer.com)\n \n pieces were copied from the PyPy project, copyrighted by the PyPy team and\n available under MIT license\ndiff --git a/hippy-c-cgi b/hippy-c-cgi\nindex b1afb330..060cd649 100755\n--- a/hippy-c-cgi\n+++ b/hippy-c-cgi\n@@ -1,3 +1,3 @@\n-#!/bin/bash\n+#!/bin/sh\n HIPPY=`dirname $0`/hippy-c\n exec $HIPPY --cgi "$@"\ndiff --git a/hippy/builtin.py b/hippy/builtin.py\nindex 71741f45..69e5af6f 100644\n--- a/hippy/builtin.py\n+++ b/hippy/builtin.py\n@@ -45,6 +45,7 @@ import os\n import inspect\n from collections import OrderedDict\n from rpython.rlib import jit\n+from rpython.rlib.objectmodel import newlist_hint\n from hippy.error import (InterpreterError, ExplicitExitException,\n                          ConvertError, FatalError, PHPException,\n                          VisibilityError)\n@@ -68,17 +69,21 @@ def _tuple_literal(names):\n     else:\n         return \'()\'\n \n+\n def handle_as_warning(interp, message):\n     raise WrongParameters(message)\n \n+\n def handle_as_exception(interp, message):\n     from hippy.builtin_klass import k_Exception\n     raise PHPException(k_Exception.call_args(\n         interp, [interp.space.wrap(message)]))\n \n+\n def handle_as_void(interp, message):\n     raise ExitSilently()\n \n+\n def argument_not(interp, _type, funcname, arg_num, given_tp, handler):\n     message = "%s() expects parameter %d to be %s, %s given" % \\\n               (funcname, arg_num, _type, interp.space.get_type_name(given_tp))\n@@ -628,45 +633,44 @@ class BuiltinFunctionBuilder(object):\n \n         source = self.make_source(check_num_args)\n         d = {\n-             \'fname\': self.funcname,\n-\n-             \'argument_not\': argument_not,\n-             \'arguments_exactly\': arguments_exactly,\n-             \'error_handler\': error_handler,\n-\n-             \'warn_exactly\': warn_exactly,\n-             \'warn_not_array\': warn_not_array,\n-\n-             \'warn_not_file_resource\': warn_not_file_resource,\n-             \'warn_not_valid_file_resource\': warn_not_valid_file_resource,\n-\n-             \'warn_not_resource\': warn_not_resource,\n-             \'warn_not_valid_resource\': warn_not_valid_resource,\n-\n-             \'warn_not_stream_context\': warn_not_stream_context,\n-             \'warn_not_valid_stream_context\': warn_not_valid_stream_context,\n-\n-             \'warn_not_mysql_link\': warn_not_mysql_link,\n-             \'warn_not_valid_mysql_link\': warn_not_valid_mysql_link,\n-\n-             \'warn_not_mysql_result\': warn_not_mysql_result,\n-             \'warn_not_valid_mysql_result\': warn_not_valid_mysql_result,\n-\n-             \'warn_not\': warn_not,\n-             \'warn_could_not_convert_to_str\': warn_could_not_convert_to_str,\n-             \'warn_at_least\': warn_at_least,\n-             \'warn_at_most\': warn_at_most,\n-\n-             \'check_reference\': check_reference,\n-             \'unroll_safe\': jit.unroll_safe,\n-             \'W_FileResource\': W_FileResource,\n-             \'W_DirResource\': W_DirResource,\n-             \'W_ArrayObject\': W_ArrayObject,\n-             \'W_InstanceObject\': W_InstanceObject,\n-             \'FatalError\': FatalError,\n-             \'ConvertError\': ConvertError,\n-             \'ExitSilently\': ExitSilently,\n-            }\n+            \'fname\': self.funcname,\n+            \'argument_not\': argument_not,\n+            \'arguments_exactly\': arguments_exactly,\n+            \'error_handler\': error_handler,\n+\n+            \'warn_exactly\': warn_exactly,\n+            \'warn_not_array\': warn_not_array,\n+\n+            \'warn_not_file_resource\': warn_not_file_resource,\n+            \'warn_not_valid_file_resource\': warn_not_valid_file_resource,\n+\n+            \'warn_not_resource\': warn_not_resource,\n+            \'warn_not_valid_resource\': warn_not_valid_resource,\n+\n+            \'warn_not_stream_context\': warn_not_stream_context,\n+            \'warn_not_valid_stream_context\': warn_not_valid_stream_context,\n+\n+            \'warn_not_mysql_link\': warn_not_mysql_link,\n+            \'warn_not_valid_mysql_link\': warn_not_valid_mysql_link,\n+\n+            \'warn_not_mysql_result\': warn_not_mysql_result,\n+            \'warn_not_valid_mysql_result\': warn_not_valid_mysql_result,\n+\n+            \'warn_not\': warn_not,\n+            \'warn_could_not_convert_to_str\': warn_could_not_convert_to_str,\n+            \'warn_at_least\': warn_at_least,\n+            \'warn_at_most\': warn_at_most,\n+            \'warn_not_mcrypt_res\': warn_not_mcrypt_res,\n+            \'check_reference\': check_reference,\n+            \'unroll_safe\': jit.unroll_safe,\n+            \'W_FileResource\': W_FileResource,\n+            \'W_DirResource\': W_DirResource,\n+            \'W_ArrayObject\': W_ArrayObject,\n+            \'W_InstanceObject\': W_InstanceObject,\n+            \'FatalError\': FatalError,\n+            \'ConvertError\': ConvertError,\n+            \'ExitSilently\': ExitSilently,\n+        }\n \n         from hippy.hippyoption import is_optional_extension_enabled\n         if is_optional_extension_enabled("mysql"):\n@@ -820,6 +824,11 @@ def warn_not_valid_mysql_result(space, funcname, arg_num, res_id, given_tp):\n                           (funcname, res_id), w_False)\n \n \n+def warn_not_mcrypt_res(space, funcname, arg_num, res_id, given_tp):\n+    raise WrongParameters("%s(): %d is not a valid MCrypt resource" %\n+                          (funcname, res_id), w_False)\n+\n+\n def warn_could_not_convert_to_str(space, w_obj):\n     klass = w_obj.getclass(space).name\n     space.ec.catchable_fatal("Object of class %s could not be "\n@@ -1056,14 +1065,22 @@ def is_subclass_of(space, w_obj, classname, allow_string=False):\n                  must_be_different=True)\n \n \n-@wrap([\'interp\', W_Root, str])\n-def method_exists(interp, w_obj, method_name):\n+def _get_class(interp, w_obj):\n+    \'\'\'Returns a class object starting from either a string or object.\'\'\'\n     klass = None\n     space = interp.space\n     if w_obj.tp == space.tp_str:\n         klass = interp._lookup_class(space.str_w(w_obj))\n     elif w_obj.tp == space.tp_object:\n         klass = space.getclass(w_obj)\n+\n+    return klass\n+\n+\n+@wrap([\'interp\', W_Root, str])\n+def method_exists(interp, w_obj, method_name):\n+    klass = _get_class(interp, w_obj)\n+    space = interp.space\n     if not klass:\n         return space.w_False\n \n@@ -1095,6 +1112,23 @@ def get_class(space, w_object=None):\n     return space.newstr(klass.name)\n \n \n+@wrap([\'interp\', W_Root])\n+def get_class_methods(interp, w_obj):\n+    \'\'\'Gets the class methods\' names.\'\'\'\n+    klass = _get_class(interp, w_obj)\n+    space = interp.space\n+    if not klass:\n+        return space.w_Null\n+\n+    contextclass = interp.get_contextclass()\n+    methods = klass.get_methods(contextclass)\n+    class_methods = newlist_hint(len(klass.methods))\n+    for method in methods:\n+        class_methods.append(space.newstr(method))\n+\n+    return space.new_array_from_list(class_methods)\n+\n+\n @wrap([\'space\'])\n def get_declared_classes(space):\n     list = []\ndiff --git a/hippy/builtin_klass.py b/hippy/builtin_klass.py\nindex eff2601e..f5d2b2fe 100644\n--- a/hippy/builtin_klass.py\n+++ b/hippy/builtin_klass.py\n@@ -50,11 +50,12 @@ class W_ExceptionObject(W_InstanceObject):\n               Optional(str), Optional(int), Optional(Nullable(\'object\'))],\n              name=\'Exception::__construct\')\n def new_exception(interp, this, message=\'\', code=0, w_previous=None):\n-    this.setattr(interp, \'file\', interp.space.wrap(this.traceback[0][0]), k_Exception)\n-    this.setattr(interp, \'message\', interp.space.wrap(message), k_Exception)\n-    this.setattr(interp, \'code\', interp.space.wrap(code), k_Exception)\n+    space = interp.space\n+    this.setattr(interp, \'file\', space.wrap(this.traceback[0][0]), k_Exception)\n+    this.setattr(interp, \'message\', space.wrap(message), k_Exception)\n+    this.setattr(interp, \'code\', space.wrap(code), k_Exception)\n     if w_previous is None:\n-        w_previous = interp.space.w_Null\n+        w_previous = space.w_Null\n     elif not k_Exception.is_parent_of(w_previous.klass):\n         interp.fatal("Wrong parameters for "\n                      "Exception([string $exception [, long $code [, "\n@@ -101,7 +102,8 @@ def exc___toString(interp, this):\n     message = space.str_w(this.getattr(interp, \'message\', k_Exception))\n     file = space.str_w(this.getattr(interp, \'file\', k_Exception))\n     line = space.int_w(this.getattr(interp, \'line\', k_Exception))\n-    msg = ["exception \'%s\' with message \'%s\' in %s:%d" % (name, message, file, line)]\n+    msg = ["exception \'%s\' with message \'%s\' in %s:%d" %\n+           (name, message, file, line)]\n     msg.append("Stack trace")\n     for i, (filename, funcname, line, source) in enumerate(this.traceback):\n         msg.append("#%d %s(%d): %s()" % (i, filename, line, funcname))\n@@ -120,25 +122,21 @@ k_Exception = def_class(\'Exception\',\n     [new_exception, exc_getMessage, exc_getCode, exc_getPrevious,\n      exc_getTrace, exc_getFile, exc_getLine, exc___toString,\n      exc_getTraceAsString],\n-          [(\'message\', consts.ACC_PROTECTED),\n-           (\'code\', consts.ACC_PROTECTED),\n-           (\'previous\', consts.ACC_PRIVATE),\n-           (\'file\', consts.ACC_PROTECTED),\n-           (\'line\', consts.ACC_PROTECTED),\n-           ],\n-          instance_class=W_ExceptionObject)\n-\n-def_class(\'OutOfBoundsException\', [], extends=k_Exception, instance_class=W_ExceptionObject)\n+    [(\'message\', consts.ACC_PROTECTED),\n+    (\'code\', consts.ACC_PROTECTED),\n+    (\'previous\', consts.ACC_PRIVATE),\n+    (\'file\', consts.ACC_PROTECTED),\n+    (\'line\', consts.ACC_PROTECTED)],\n+    instance_class=W_ExceptionObject)\n+\n+def_class(\'OutOfBoundsException\', [], extends=k_Exception)\n k_stdClass = def_class(\'stdClass\', [])\n k_incomplete = def_class(\'__PHP_Incomplete_Class\', [])\n-k_RuntimeException = def_class(\'RuntimeException\', [], extends=k_Exception, instance_class=W_ExceptionObject)\n-k_LogicException = def_class(\'LogicException\', [], extends=k_Exception, instance_class=W_ExceptionObject)\n-k_DomainException = def_class(\'DomainException\', [], extends=k_Exception, instance_class=W_ExceptionObject)\n+k_RuntimeException = def_class(\'RuntimeException\', [], extends=k_Exception)\n+k_LogicException = def_class(\'LogicException\', [], extends=k_Exception)\n+k_DomainException = def_class(\'DomainException\', [], extends=k_Exception)\n k_UnexpectedValueException = def_class(\'UnexpectedValueException\', [],\n-        extends=k_Exception, instance_class=W_ExceptionObject)\n-\n-\n-\n+                                       extends=k_Exception)\n \n \n def new_abstract_method(args, **kwds):\n@@ -162,22 +160,6 @@ k_Iterator = def_class(\'Iterator\',\n )\n \n \n-def_class(\'SeekableIterator\',\n-    [new_abstract_method(["interp"], name="SeekableIterator::seek")],\n-    flags=consts.ACC_INTERFACE | consts.ACC_ABSTRACT, implements=[k_Iterator])\n-\n-\n-def_class(\'RecursiveIterator\',\n-    [new_abstract_method(["interp"], name="RecursiveIterator::hasChildren"),\n-     new_abstract_method(["interp"], name="RecursiveIterator::getChildren")],\n-    flags=consts.ACC_INTERFACE | consts.ACC_ABSTRACT, implements=[k_Iterator])\n-\n-\n-def_class(\'Countable\',\n-    [new_abstract_method(["interp"], name="Countable::count")],\n-    flags=consts.ACC_INTERFACE | consts.ACC_ABSTRACT)\n-\n-\n ArrayAccess = def_class(\'ArrayAccess\', [\n     new_abstract_method(["interp"], name="ArrayAccess::offsetExists"),\n     new_abstract_method(["interp"], name="ArrayAccess::offsetGet"),\ndiff --git a/hippy/bytecode_cache.py b/hippy/bytecode_cache.py\nindex 04ba4d43..60832389 100644\n--- a/hippy/bytecode_cache.py\n+++ b/hippy/bytecode_cache.py\n@@ -2,35 +2,15 @@\n import os\n import time\n from hippy.phpcompiler import compile_php\n-from hippy.rpath import exists, dirname, join, abspath\n+from hippy.rpath import abspath\n \n TIMEOUT = 1.0\n \n class BytecodeCache(object):\n     def __init__(self, timeout=TIMEOUT):\n         self.cached_files = {}\n-        self.cached_filenames = {}\n         self.timeout = timeout\n \n-    def find_file(self, interp, fname):\n-        try:\n-            return self.cached_filenames[fname]\n-        except KeyError:\n-            actual_name = self._find_file(interp, fname)\n-            self.cached_filenames[fname] = actual_name\n-            return actual_name\n-\n-    def _find_file(self, interp, fname):\n-        if not exists(fname):\n-            for path in interp.include_path:\n-                if exists(join(path, [fname])):\n-                    return join(path, [fname])\n-        # this is stupid, but...\n-        actual_code_dir = dirname(interp.global_frame.bytecode.filename)\n-        if exists(join(actual_code_dir, [fname])):\n-            return join(actual_code_dir, [fname])\n-        return abspath(fname)\n-\n     def compile_file(self, fname, space):\n         absname = abspath(fname)\n         now = time.time()\ndiff --git a/hippy/config.py b/hippy/config.py\nindex 97d302fc..6a7de45a 100644\n--- a/hippy/config.py\n+++ b/hippy/config.py\n@@ -8,7 +8,7 @@ from hippy.lexer import Token, BaseLexer\n from hippy.sourceparser import BaseParser\n \n EXTENSIONS = [\'session\', \'standard\', \'mysql\', \'pcre\', \'posix\', \'Core\',\n-              \'xml\', \'ctype\', \'hash\', \'spl\', \'mbstring\']\n+              \'xml\', \'ctype\', \'hash\', \'spl\', \'mbstring\', \'mcrypt\']\n \n \n class Config(object):\ndiff --git a/hippy/constants.py b/hippy/constants.py\nindex 72c24623..6fb2c9e9 100644\n--- a/hippy/constants.py\n+++ b/hippy/constants.py\n@@ -1453,7 +1453,50 @@ CONSTS = OrderedDict(\n         MYSQL_CLIENT_COMPRESS=32,\n         MYSQL_CLIENT_SSL=2048,\n         MYSQL_CLIENT_INTERACTIVE=1024,\n-        MYSQL_CLIENT_IGNORE_SPACE=256)\n+        MYSQL_CLIENT_IGNORE_SPACE=256),\n+    mcrypt=OrderedDict(\n+        MCRYPT_DEV_RANDOM=0,\n+        MCRYPT_DEV_URANDOM=1,\n+        MCRYPT_RAND=2,\n+        MCRYPT_ENCRYPT=0,\n+        MCRYPT_DECRYPT=1,\n+        MCRYPT_3DES="tripledes",\n+        MCRYPT_ARCFOUR_IV="arcfour-iv",\n+        MCRYPT_ARCFOUR="arcfour",\n+        MCRYPT_BLOWFISH="blowfish",\n+        MCRYPT_BLOWFISH_COMPAT="blowfish_compat",\n+        MCRYPT_CAST_128="cast-128",\n+        MCRYPT_CAST_256="cast-256",\n+        MCRYPT_CRYPT="crypt",\n+        MCRYPT_DES="des",\n+        MCRYPT_ENIGNA="crypt",\n+        MCRYPT_GOST="gost",\n+        MCRYPT_LOKI97="loki97",\n+        MCRYPT_PANAMA="panama",\n+        MCRYPT_RC2="rc2",\n+        MCRYPT_RIJNDAEL_128="rijndael-128",\n+        MCRYPT_RIJNDAEL_192="rijndael-192",\n+        MCRYPT_RIJNDAEL_256="rijndael-256",\n+        MCRYPT_SAFER64="safer-sk64",\n+        MCRYPT_SAFER128="safer-sk128",\n+        MCRYPT_SAFERPLUS="saferplus",\n+        MCRYPT_SERPENT="serpent",\n+        MCRYPT_THREEWAY="threeway",\n+        MCRYPT_TRIPLEDES="tripledes",\n+        MCRYPT_TWOFISH="twofish",\n+        MCRYPT_WAKE="wake",\n+        MCRYPT_XTEA="xtea",\n+        MCRYPT_IDEA="idea",\n+        MCRYPT_MARS="mars",\n+        MCRYPT_RC6="rc6",\n+        MCRYPT_SKIPJACK="skipjack",\n+        MCRYPT_MODE_CBC="cbc",\n+        MCRYPT_MODE_ECB="ecb",\n+        MCRYPT_MODE_CFB="cfb",\n+        MCRYPT_MODE_NOFB="nofb",\n+        MCRYPT_MODE_OFB="ofb",\n+        MCRYPT_MODE_STREAM="stream",\n+    ),\n )\n \n \ndiff --git a/hippy/frame.py b/hippy/frame.py\nindex dad61ff3..ac360d23 100644\n--- a/hippy/frame.py\n+++ b/hippy/frame.py\n@@ -317,6 +317,7 @@ class Frame(object):\n         else:\n             self.unset_ref(no)\n \n+    @jit.unroll_safe\n     def load_from_scope(self, scope):\n         self.extra_variables = scope.dct_w\n         varnames = self.bytecode.varnames\ndiff --git a/hippy/hippyoption.py b/hippy/hippyoption.py\nindex a1582422..56f20db3 100644\n--- a/hippy/hippyoption.py\n+++ b/hippy/hippyoption.py\n@@ -3,7 +3,7 @@ from rpython.rlib.objectmodel import specialize\n \n class HippyOptionError(Exception): pass\n \n-OPTIONAL_EXTS = ["mysql", "hash", "fastcgi", "xml"]\n+OPTIONAL_EXTS = ["mysql", "hash", "fastcgi", "xml", "mcrypt"]\n \n optexts_descriptions = [\n         BoolOption("allexts", "Enable all extensions",\n@@ -26,13 +26,16 @@ top_hippy_optiondescription = \\\n             BoolOption("translating", "Are we translating?", default=False),\n             hippy_optiondescription])\n \n+\n OPTIONS = Config(top_hippy_optiondescription) # default config\n \n+\n def set_options(config):\n     import sys\n     thismod = sys.modules[__name__]\n     setattr(thismod, "OPTIONS", config)\n \n+\n def enable_all_optional_extensions():\n     for extname in OPTIONAL_EXTS:\n         setattr(OPTIONS.optexts, extname, True)\n@@ -50,9 +53,3 @@ def is_optional_extension_enabled(extname):\n         return getattr(OPTIONS.optexts, extname) and on_import_path\n     except AttributeError:\n         raise HippyOptionError("No optional extension named \'%s\'" % extname)\n-\n-\n-\n-\n-\n-\ndiff --git a/hippy/interpreter.py b/hippy/interpreter.py\nindex 5398ffdc..b7715104 100644\n--- a/hippy/interpreter.py\n+++ b/hippy/interpreter.py\n@@ -38,6 +38,7 @@ from rpython.rlib import jit\n from rpython.rlib import rsignal\n from rpython.rlib.unroll import unrolling_iterable\n from rpython.rlib.rfile import create_popen_file\n+from rpython.rlib.rpath import exists, dirname, join, abspath\n \n from hippy.module.session import Session\n \n@@ -88,6 +89,8 @@ if is_optional_extension_enabled("hash"):\n if is_optional_extension_enabled("xml"):\n     import ext_module.xml.interface\n \n+if is_optional_extension_enabled("mcrypt"):\n+    import ext_module.mcrypt.funcs\n \n \n def get_printable_location(pc, bytecode, contextclass=None):\n@@ -229,7 +232,6 @@ class Interpreter(object):\n         self.topframeref = jit.vref_None\n         self.error_handler = None\n         space.ec.interpreter = self  # one interpreter at a time\n-        space.ec.init_signals()\n         self._autoloading = {}\n         self.autoload_stack = []\n         self.autoload_extensions = [\'.inc\', \'.php\']\n@@ -661,8 +663,6 @@ class Interpreter(object):\n     def send_headers(self):\n         self.any_output = True\n         if self.cgi:\n-            if self.cgi != constants.CGI_FASTCGI:\n-                self._writestr("\\r\\n")\n             if self.http_status_code != -1:\n                 self._writestr(\'Status: %d\\r\\n\' % self.http_status_code)\n             for k in self.headers:\n@@ -793,6 +793,7 @@ class Interpreter(object):\n             self.setup()\n         frame = Frame(self, bytecode, is_global_level=True)\n         frame.load_from_scope(self.globals)\n+        old_global_frame = self.global_frame\n         self.global_frame = frame\n         if top_main:\n             try:\n@@ -812,6 +813,7 @@ class Interpreter(object):\n                     self.flush_buffers()\n         else:\n             w_result = self.interpret(frame)\n+            self.global_frame = old_global_frame\n         return w_result\n \n     def run_local_include(self, bytecode, parent_frame):\n@@ -1333,7 +1335,7 @@ class Interpreter(object):\n \n \n     def GETFUNC(self, bytecode, frame, space, arg, pc):\n-        w_name = frame.pop().deref()\n+        w_name = frame.pop().deref()            \n         func = self.getfunc(w_name, frame.w_this, frame.get_contextclass())\n         assert func is not None\n         frame.push(func)\n@@ -1824,10 +1826,25 @@ class Interpreter(object):\n             frame.push(self.space.w_False)\n             return\n \n+    def find_file(self, fname):\n+        """Resolve a file name relative to the include_path and to\n+        the location of the current code"""\n+        for path in self.include_path:\n+            if exists(join(path, [fname])):\n+                return abspath(join(path, [fname]))\n+        code_dir = dirname(self.get_frame().bytecode.filename)\n+        if exists(join(code_dir, [fname])):\n+            return abspath(join(code_dir, [fname]))\n+        return abspath(fname)\n+\n     def _include(self, frame, func_name, require=False, once=False):\n         name = self.space.str_w(frame.pop())\n-        #print "INCLUDE", name\n-        fname = self.space.bytecode_cache.find_file(self, name)\n+        use_path = not (name.startswith(\'/\') or name.startswith(\'./\') or\n+                        name.startswith(\'../\'))\n+        if use_path:\n+            fname = self.find_file(name)\n+        else:\n+            fname = abspath(name)\n         if once is True and fname in self.cached_files:\n             frame.push(self.space.newint(1))\n             return\ndiff --git a/hippy/klass.py b/hippy/klass.py\nindex c9aadc0f..c84186ae 100644\n--- a/hippy/klass.py\n+++ b/hippy/klass.py\n@@ -51,7 +51,6 @@ def normalize_access(access_flags):\n \n class ClassBase(AbstractFunction, AccessMixin):\n     access_flags = 0\n-    extends_name = None\n     base_interface_names = None\n     constructor_method = None\n     method__clone = None\n@@ -279,6 +278,18 @@ class ClassBase(AbstractFunction, AccessMixin):\n         else:\n             return None\n \n+    def get_methods(self, contextclass):\n+        \'\'\'Returns a list of accessible method names for the given context.\'\'\'\n+        methods = []\n+        for method_name, method in self.methods.iteritems():\n+            try:\n+                self._visibility_check(method, method_name, contextclass)\n+                methods.append(method.get_name())\n+            except VisibilityError:\n+                pass\n+\n+        return methods\n+\n     def lookup_staticmember(self, name, contextclass, check_visibility):\n         property = self._lookup_property(name, contextclass, check_visibility)\n         if property is not None and property.is_static():\n@@ -625,44 +636,29 @@ def def_class(name, methods=[], properties=[], constants=[],\n class BuiltinClass(ClassBase):\n     def __init__(self, name,\n                  methods=[], properties=[], constants=[], instance_class=None,\n-                 flags=0, implements=[], extends=None, is_iterator=False, is_array_access=False):\n-        if extends is not None and not isinstance(extends, BuiltinClass):\n-            extends = all_builtin_classes[extends]\n-        implements = [(intf if isinstance(intf, BuiltinClass) else\n-            all_builtin_classes[intf]) for intf in implements]\n-\n+                 flags=0, implements=[], extends=None, is_iterator=False,\n+                 is_array_access=False):\n         ClassBase.__init__(self, name)\n+        self._init_instance_class(extends, instance_class)\n+        for func in methods:\n+            meth = Method(func, func.flags, self)\n+            self.methods[meth.get_identifier()] = meth\n+        for prop in properties:\n+            self._make_property(prop, w_Null)\n+        for name, w_value in constants:\n+            self.constants_w[name] = w_value\n \n         self.immediate_parents = []\n         if extends is not None:\n             self.parentclass = extends\n-            self.extends_name = extends.name\n-\n             if self.constructor_method is None:\n                 self.constructor_method = extends.constructor_method\n \n-            if instance_class is None:\n-                self.custom_instance_class = extends.custom_instance_class\n-            else:\n-                assert extends.custom_instance_class is None or issubclass(\n-                    instance_class, extends.custom_instance_class)\n-                self.custom_instance_class = instance_class\n-\n             for method in extends.methods.itervalues():\n                 self._inherit_method(method)\n             for p in extends.properties.itervalues():\n                 self._inherit_property(p)\n             self.immediate_parents.append(self.parentclass)\n-        else:\n-            self.custom_instance_class = instance_class\n-\n-        for func in methods:\n-            meth = Method(func, func.flags, self)\n-            self.methods[meth.get_identifier()] = meth\n-        for prop in properties:\n-            self._make_property(prop, w_Null)\n-        for name, w_value in constants:\n-            self.constants_w[name] = w_value\n \n         self.access_flags = flags\n         self.base_interface_names = [intf.name for intf in implements]\n@@ -693,6 +689,17 @@ class BuiltinClass(ClassBase):\n             for parent_id in base.all_parents:\n                 self.all_parents[parent_id] = None\n \n+    def _init_instance_class(self, extends, instance_class):\n+        if extends is not None:\n+            if instance_class is None:\n+                self.custom_instance_class = extends.custom_instance_class\n+            else:\n+                assert extends.custom_instance_class is None or issubclass(\n+                    instance_class, extends.custom_instance_class)\n+                self.custom_instance_class = instance_class\n+        else:\n+            self.custom_instance_class = instance_class\n+\n \n class ClassDeclaration(AbstractFunction, AccessMixin):\n     """Compile-time object representing an app-level class declaration.\ndiff --git a/hippy/lexer.py b/hippy/lexer.py\nindex 36ff1dbe..b567072a 100644\n--- a/hippy/lexer.py\n+++ b/hippy/lexer.py\n@@ -350,7 +350,7 @@ RULES_FOR_BACKTICK = [(parse_regex(rule), name) for rule, name in _RULES_FOR_BAC\n _RULES_FOR_HEREDOC = (\n     ("\\$[a-zA-Z_][0-9a-zA-Z_]*(->[a-zA-Z_][0-9a-zA-Z_]*)?", \'T_VARIABLE\'),\n     (r"\\{\\$|\\$\\{", "T_DOLLAR_OPEN_CURLY_BRACES"),\n-    (r"([^\\$\\{\\\\]|\\\\.|\\$[^a-zA-Z\\"\\{]|{[^\\$])+", "T_ENCAPSED_AND_WHITESPACE"),\n+    (r"([^\\$\\{\\\\]|\\\\.|\\$[^a-zA-Z_\\{]|{[^\\$])+", "T_ENCAPSED_AND_WHITESPACE"),\n )\n \n RULES_FOR_HEREDOC = [(parse_regex(rule), name) for rule, name in _RULES_FOR_HEREDOC]\ndiff --git a/hippy/main.py b/hippy/main.py\nindex 0cdccce8..4add688f 100755\n--- a/hippy/main.py\n+++ b/hippy/main.py\n@@ -21,6 +21,7 @@ from hippy.objspace import getspace\n from hippy.error import ExplicitExitException, InterpreterError, SignalReceived\n from hippy.config import load_ini\n from hippy.sourceparser import ParseError\n+from hippy.lexer import LexerError\n from rpython.rlib.rgc import dump_rpy_heap\n from rpython.rlib.objectmodel import we_are_translated\n from hippy import rpath\n@@ -125,8 +126,17 @@ def main(filename, rest_of_args, cgi, gcdump, debugger_pipes=(-1, -1),\n \n     try:\n         bc = space.bytecode_cache.compile_file(absname, space)\n-    except:\n-        print "Error opening %s" % filename\n+    except ParseError as e:\n+        print \'Parse error:  %s\' % e\n+        return 2\n+    except LexerError as e:\n+        print \'Parse error:  %s on line %d\' % (e.message, e.source_pos + 1)\n+        return 2\n+    except IOError as e:\n+        print \'Could not open input file: %s\' % filename\n+        return 2\n+    except Exception as e:\n+        print \'Got exception: %s\' % e\n         return 2\n     #\n     if bench_mode:\n@@ -135,6 +145,7 @@ def main(filename, rest_of_args, cgi, gcdump, debugger_pipes=(-1, -1),\n         no = 1\n \n     exitcode = 0\n+    space.ec.init_signals()\n     for i in range(no):\n         # load the ini file situated in the current wc\n         interp.setup(cgi, argv=[filename] + rest_of_args)\ndiff --git a/hippy/module/posix/funcs.py b/hippy/module/posix/funcs.py\nindex af99c2df..07e0154c 100644\n--- a/hippy/module/posix/funcs.py\n+++ b/hippy/module/posix/funcs.py\n@@ -3,7 +3,7 @@ import posix\n from hippy.builtin import LongArg, wrap, Optional, FilenameArg\n from hippy.objects.base import W_Root\n from hippy.objects.resources import W_Resource\n-from hippy.rpwd import getpwnam, getpwuid, initgroups\n+from hippy.rpwd import getpwnam, getpwuid, initgroups, getgrgid, getgrnam\n from rpython.rtyper.lltypesystem import rffi, lltype\n from rpython.rlib import rposix\n from rpython.rlib.rarithmetic import intmask\n@@ -75,8 +75,36 @@ def posix_getgid(space):\n     """ posix_getgid - Return the real group ID of the current process """\n     return space.newint(os.getgid())\n \n-""" posix_getgrgid - Return info about a group by group id """\n-""" posix_getgrnam - Return info about a group by name """\n+\n+def _build_group_info(space, res):\n+    members = []\n+    for member in rffi.charpp2liststr(res.c_gr_mem):\n+        members.append(space.newstr(member))\n+\n+    return space.new_array_from_pairs([\n+        (space.newstr("name"), space.newstr(rffi.charp2str(res.c_gr_name))),\n+        (space.newstr("passwd"), space.newstr(rffi.charp2str(res.c_gr_passwd))),\n+        (space.newstr("members"), space.new_array_from_list(members)),\n+        (space.newstr("gid"), space.newint(intmask(res.c_gr_gid))),\n+    ])\n+\n+\n+@wrap([\'space\', int], error=False)\n+def posix_getgrgid(space, gid):\n+    """Return info about a group by group id."""\n+    res = getgrgid(gid)\n+    if not res:\n+        return space.newbool(False)\n+    return _build_group_info(space, res)\n+\n+\n+@wrap([\'space\', str], error=False)\n+def posix_getgrnam(space, name):\n+    """Return info about a group by name."""\n+    res = getgrnam(rffi.str2charp(name))\n+    if not res:\n+        return space.newbool(False)\n+    return _build_group_info(space, res)\n \n \n @wrap([\'space\'])\ndiff --git a/hippy/module/spl/arrayiter.py b/hippy/module/spl/arrayiter.py\nindex bea2da06..12d3c53a 100644\n--- a/hippy/module/spl/arrayiter.py\n+++ b/hippy/module/spl/arrayiter.py\n@@ -1,5 +1,5 @@\n-from hippy.builtin_klass import wrap_method\n-from hippy.builtin import ThisUnwrapper, Optional\n+from hippy.builtin_klass import k_Iterator\n+from hippy.builtin import ThisUnwrapper, Optional, wrap_method\n from hippy.klass import def_class\n from hippy.objects.base import W_Root\n from hippy.objects.instanceobject import W_InstanceObject\n@@ -44,14 +44,14 @@ def ArrayIterator_valid():\n     pass\n \n \n-k_ArrayIterator = def_class(\'ArrayIterator\', [\n-        ArrayIterator_construct,\n-        ArrayIterator_current,\n-        ArrayIterator_next,\n-        ArrayIterator_key,\n-        ArrayIterator_rewind,\n-        ArrayIterator_valid],\n+k_ArrayIterator = def_class(\n+    \'ArrayIterator\',\n+    [ArrayIterator_construct,\n+     ArrayIterator_current,\n+     ArrayIterator_next,\n+     ArrayIterator_key,\n+     ArrayIterator_rewind,\n+     ArrayIterator_valid],\n     [(\'storage\', consts.ACC_PRIVATE)],\n     instance_class=W_ApplevelArrayIterator,\n-    implements=["Iterator"]\n-)\n+    implements=[k_Iterator])\ndiff --git a/hippy/module/spl/interface.py b/hippy/module/spl/interface.py\nnew file mode 100644\nindex 00000000..c9e9f58f\n--- /dev/null\n+++ b/hippy/module/spl/interface.py\n@@ -0,0 +1,20 @@\n+"""Interfaces defined by the SPL extension"""\n+\n+from hippy import consts\n+from hippy.klass import def_class\n+from hippy.builtin_klass import new_abstract_method, k_Iterator\n+\n+k_SeekableIterator = def_class(\'SeekableIterator\',\n+    [new_abstract_method(["interp"], name="SeekableIterator::seek")],\n+    flags=consts.ACC_INTERFACE | consts.ACC_ABSTRACT, extends=k_Iterator)\n+\n+\n+k_RecursiveIterator = def_class(\'RecursiveIterator\',\n+    [new_abstract_method(["interp"], name="RecursiveIterator::hasChildren"),\n+     new_abstract_method(["interp"], name="RecursiveIterator::getChildren")],\n+    flags=consts.ACC_INTERFACE | consts.ACC_ABSTRACT, extends=k_Iterator)\n+\n+\n+def_class(\'Countable\',\n+    [new_abstract_method(["interp"], name="Countable::count")],\n+    flags=consts.ACC_INTERFACE | consts.ACC_ABSTRACT)\ndiff --git a/hippy/module/spl/spl.py b/hippy/module/spl/spl.py\nindex 66201638..da825d8a 100644\n--- a/hippy/module/spl/spl.py\n+++ b/hippy/module/spl/spl.py\n@@ -8,6 +8,7 @@ from hippy.objects.resources.dir_resource import W_DirResource\n from hippy.error import PHPException\n from hippy.builtin_klass import (def_class, k_RuntimeException,\n     k_LogicException, k_UnexpectedValueException, GetterSetterWrapper)\n+from hippy.module.spl.interface import k_SeekableIterator, k_RecursiveIterator\n from hippy.module.standard.file.funcs import (_is_dir, _is_file, _is_link,\n     _is_executable, _is_readable, _is_writable, _filetype, _fseek, _fstat,\n     _fopen, _basename, FopenError)\n@@ -112,8 +113,7 @@ def get_group(interp, this):\n     except OSError:\n         raise PHPException(k_RuntimeException.call_args(\n             interp, [interp.space.wrap(\n-                "SplFileInfo::getGroup(): stat failed for %s" % filename\n-                )]))\n+                "SplFileInfo::getGroup(): stat failed for %s" % filename)]))\n \n \n def _get_inode(interp, filename):\n@@ -322,10 +322,10 @@ def openfile(interp, this, open_mode=\'r\', use_include_path=False, w_ctx=None):\n     if open_mode == \'\':\n         raise PHPException(k_RuntimeException.call_args(\n             interp, [interp.space.wrap(\n-                    "SplFileInfo::openFile(): Invalid parameters")]))\n+                "SplFileInfo::openFile(): Invalid parameters")]))\n \n     args = [interp.space.wrap(this.file_name), interp.space.wrap(open_mode),\n-             interp.space.wrap(use_include_path)]\n+            interp.space.wrap(use_include_path)]\n     if w_ctx:\n         if not interp.space.is_resource(w_ctx):\n             raise PHPException(k_RuntimeException.call_args(\n@@ -362,8 +362,8 @@ def _set_filename(interp, this, value):\n     raise NotImplementedError()\n \n \n-SplFileInfoClass = def_class(\n-        \'SplFileInfo\',\n+k_SplFileInfo = def_class(\n+    \'SplFileInfo\',\n     methods=[construct,\n              spl_toString,\n              get_basename,\n@@ -393,8 +393,7 @@ SplFileInfoClass = def_class(\n                                     "pathName", consts.ACC_PRIVATE),\n                 GetterSetterWrapper(_get_filename, _set_filename,\n                                     "fileName", consts.ACC_PRIVATE), ],\n-        instance_class=W_SplFileInfo\n-        )\n+    instance_class=W_SplFileInfo)\n \n \n SFO_DROP_NEW_LINE = 1\n@@ -439,15 +438,14 @@ def sfo_construct(interp, this, filename, open_mode=\'r\',\n     if os.path.isdir(filename):\n         raise PHPException(k_LogicException.call_args(\n             interp, [interp.space.wrap(\n-                "Cannot use SplFileObject with directories"\n-                )]))\n+                "Cannot use SplFileObject with directories")]))\n     try:\n         this.w_res = _fopen(interp.space, filename, this.open_mode,\n                             use_include_path, w_ctx)\n         if this.w_res == interp.space.w_False:\n             raise PHPException(k_RuntimeException.call_args(\n                 interp, [interp.space.wrap(\n-                "SplFileObject::__construct(): Failed to open stream")]))\n+                    "SplFileObject::__construct(): Failed to open stream")]))\n     except FopenError as e:\n         raise PHPException(k_RuntimeException.call_args(interp,\n             [interp.space.wrap(e.reasons.pop())]))\n@@ -753,15 +751,15 @@ SplFileObjectClass = def_class(\n                 GetterSetterWrapper(_get_delimiter, _set_delimiter,\n                                     "delimiter", consts.ACC_PRIVATE),\n                 GetterSetterWrapper(_get_enclosure, _set_enclosure,\n-                                    "enclosure", consts.ACC_PRIVATE),],\n+                                    "enclosure", consts.ACC_PRIVATE)],\n     constants=[\n         (\'DROP_NEW_LINE\', W_IntObject(SFO_DROP_NEW_LINE)),\n         (\'READ_AHEAD\', W_IntObject(SFO_READ_AHEAD)),\n         (\'SKIP_EMPTY\', W_IntObject(SFO_SKIP_EMPTY)),\n         (\'READ_CSV\', W_IntObject(SFO_READ_CSV))],\n-    implements=["RecursiveIterator", "SeekableIterator"],\n+    implements=[k_RecursiveIterator, k_SeekableIterator],\n     instance_class=W_SplFileObject,\n-    extends=\'SplFileInfo\',)\n+    extends=k_SplFileInfo,)\n \n \n class W_DirectoryIterator(W_SplFileInfo):\n@@ -782,8 +780,7 @@ def di_construct(interp, this, path):\n     if path == "":\n         raise PHPException(k_RuntimeException.call_args(\n             interp, [interp.space.wrap(\n-                "Directory name must not be empty."\n-                )]))\n+                "Directory name must not be empty.")]))\n     this.path = path\n     this.file_name = path\n     this.index = 0\n@@ -803,7 +800,7 @@ def di_construct(interp, this, path):\n         raise PHPException(k_RuntimeException.call_args(\n             interp, [interp.space.wrap(\n                 "DirectoryIterator::__construct(): error while opening stream"\n-                )]))\n+            )]))\n \n \n @wrap_method([\'interp\', ThisUnwrapper(W_DirectoryIterator)],\n@@ -1066,7 +1063,7 @@ def di_getmtime(interp, this):\n         return interp.space.w_False\n \n \n-DirectoryIteratorClass = def_class(\n+k_DirectoryIterator = def_class(\n     \'DirectoryIterator\',\n     [di_construct,\n      di_current,\n@@ -1097,9 +1094,9 @@ DirectoryIteratorClass = def_class(\n      di_getctime,\n      di_getmtime,\n      di_tostring],\n-    implements=["SeekableIterator"],\n+    implements=[k_SeekableIterator],\n     instance_class=W_DirectoryIterator,\n-    extends=\'SplFileInfo\',)\n+    extends=k_SplFileInfo,)\n \n \n FI_CURRENT_AS_PATHNAME = 32\n@@ -1167,7 +1164,7 @@ def fi_current(interp, this):\n         return interp.space.newstr(pathname)\n     else:\n         filename = _di_pathname(this)\n-        file_info = SplFileInfoClass.call_args(interp,\n+        file_info = k_SplFileInfo.call_args(interp,\n                 [interp.space.wrap(filename)])\n         return file_info\n \n@@ -1186,40 +1183,43 @@ def fi_key(interp, this):\n @wrap_method([\'interp\', ThisUnwrapper(W_FilesystemIterator)],\n              name=\'FilesystemIterator::getFlags\')\n def fi_get_flags(interp, this):\n-    flags = this.flags & (FI_KEY_MODE_MASK | FI_CURRENT_MODE_MASK | FI_OTHER_MODE_MASK)\n+    flags = this.flags & (FI_KEY_MODE_MASK | FI_CURRENT_MODE_MASK |\n+                          FI_OTHER_MODE_MASK)\n     return interp.space.newint(flags)\n \n \n @wrap_method([\'interp\', ThisUnwrapper(W_FilesystemIterator), int],\n              name=\'FilesystemIterator::setFlags\')\n def fi_set_flags(interp, this, flags):\n-    this.flags &= ~(FI_KEY_MODE_MASK | FI_CURRENT_MODE_MASK | FI_OTHER_MODE_MASK)\n-    this.flags |= ((FI_KEY_MODE_MASK | FI_CURRENT_MODE_MASK | FI_OTHER_MODE_MASK) & flags)\n-\n-\n-FilesystemIteratorClass = def_class(\n-        \'FilesystemIterator\',\n-        [fi_construct,\n-         fi_current,\n-         fi_key,\n-         fi_get_flags,\n-         fi_set_flags],\n-        constants=[\n-            (\'CURRENT_AS_PATHNAME\', W_IntObject(FI_CURRENT_AS_PATHNAME)),\n-            (\'CURRENT_AS_FILEINFO\', W_IntObject(FI_CURRENT_AS_FILEINFO)),\n-            (\'CURRENT_AS_SELF\', W_IntObject(FI_CURRENT_AS_SELF)),\n-            (\'CURRENT_MODE_MASK\', W_IntObject(FI_CURRENT_MODE_MASK)),\n-            (\'KEY_AS_PATHNAME\', W_IntObject(FI_KEY_AS_PATHNAME)),\n-            (\'KEY_AS_FILENAME\', W_IntObject(FI_KEY_AS_FILENAME)),\n-            (\'FOLLOW_SYMLINKS\', W_IntObject(FI_FOLLOW_SYMLINKS)),\n-            (\'KEY_MODE_MASK\', W_IntObject(FI_KEY_MODE_MASK)),\n-            (\'NEW_CURRENT_AND_KEY\', W_IntObject(FI_NEW_CURRENT_AND_KEY)),\n-            (\'SKIP_DOTS\', W_IntObject(FI_SKIP_DOTS)),\n-            (\'UNIX_PATHS\', W_IntObject(FI_UNIX_PATHS)),\n-            (\'OTHER_MODE_MASK\', W_IntObject(FI_OTHER_MODE_MASK)),],\n-        implements=[\'SeekableIterator\'],\n-        instance_class=W_FilesystemIterator,\n-        extends=\'DirectoryIterator\',)\n+    this.flags &= ~(FI_KEY_MODE_MASK | FI_CURRENT_MODE_MASK |\n+                    FI_OTHER_MODE_MASK)\n+    this.flags |= ((FI_KEY_MODE_MASK | FI_CURRENT_MODE_MASK |\n+                    FI_OTHER_MODE_MASK) & flags)\n+\n+\n+k_FilesystemIterator = def_class(\n+    \'FilesystemIterator\',\n+    [fi_construct,\n+        fi_current,\n+        fi_key,\n+        fi_get_flags,\n+        fi_set_flags],\n+    constants=[\n+        (\'CURRENT_AS_PATHNAME\', W_IntObject(FI_CURRENT_AS_PATHNAME)),\n+        (\'CURRENT_AS_FILEINFO\', W_IntObject(FI_CURRENT_AS_FILEINFO)),\n+        (\'CURRENT_AS_SELF\', W_IntObject(FI_CURRENT_AS_SELF)),\n+        (\'CURRENT_MODE_MASK\', W_IntObject(FI_CURRENT_MODE_MASK)),\n+        (\'KEY_AS_PATHNAME\', W_IntObject(FI_KEY_AS_PATHNAME)),\n+        (\'KEY_AS_FILENAME\', W_IntObject(FI_KEY_AS_FILENAME)),\n+        (\'FOLLOW_SYMLINKS\', W_IntObject(FI_FOLLOW_SYMLINKS)),\n+        (\'KEY_MODE_MASK\', W_IntObject(FI_KEY_MODE_MASK)),\n+        (\'NEW_CURRENT_AND_KEY\', W_IntObject(FI_NEW_CURRENT_AND_KEY)),\n+        (\'SKIP_DOTS\', W_IntObject(FI_SKIP_DOTS)),\n+        (\'UNIX_PATHS\', W_IntObject(FI_UNIX_PATHS)),\n+        (\'OTHER_MODE_MASK\', W_IntObject(FI_OTHER_MODE_MASK))],\n+    implements=[k_SeekableIterator],\n+    instance_class=W_FilesystemIterator,\n+    extends=k_DirectoryIterator,)\n \n \n class W_RecursiveDirectoryIterator(W_FilesystemIterator):\n@@ -1286,7 +1286,7 @@ def rdi_get_children(interp, this):\n     else:\n         if this.w_dir_res.index < this.w_dir_res.no_of_items:\n             filename = _di_pathname(this)\n-            sub_dir_iter = RecursiveDirectoryIteratorClass.call_args(interp,\n+            sub_dir_iter = k_RecursiveDirectoryIterator.call_args(interp,\n                     [interp.space.wrap(filename)])\n             return sub_dir_iter\n         else:\n@@ -1305,14 +1305,13 @@ def rdi_get_subpathname(interp, this):\n     raise NotImplementedError\n \n \n-RecursiveDirectoryIteratorClass = def_class(\n-        \'RecursiveDirectoryIterator\',\n-        [rdi_construct,\n-         rdi_has_children,\n-         rdi_get_children,\n-         rdi_get_subpath,\n-         rdi_get_subpathname,\n-        ],\n-        implements=[\'SeekableIterator\', \'RecursiveIterator\'],\n-        instance_class=W_RecursiveDirectoryIterator,\n-        extends=\'FilesystemIterator\',)\n+k_RecursiveDirectoryIterator = def_class(\n+    \'RecursiveDirectoryIterator\',\n+    [rdi_construct,\n+     rdi_has_children,\n+     rdi_get_children,\n+     rdi_get_subpath,\n+     rdi_get_subpathname, ],\n+    implements=[k_SeekableIterator, k_RecursiveIterator],\n+    instance_class=W_RecursiveDirectoryIterator,\n+    extends=k_FilesystemIterator,)\ndiff --git a/hippy/module/standard/array/funcs.py b/hippy/module/standard/array/funcs.py\nindex 291f59c9..28aa1ef2 100644\n--- a/hippy/module/standard/array/funcs.py\n+++ b/hippy/module/standard/array/funcs.py\n@@ -872,13 +872,10 @@ def array_product(space, w_arr):\n     return space.wrap(res)\n \n \n-@wrap([\'space\', UniqueArray(accept_instance=False), \'args_w\'])\n-def array_push(space, w_arr, args_w):\n+@wrap([\'space\', UniqueArray(accept_instance=False), W_Root, \'args_w\'])\n+def array_push(space, w_arr, w_value1, args_w):\n     """ Push one or more elements onto the end of array """\n-    if len(args_w) < 1:\n-        space.ec.warn("array_push(): at least 2 parameters are required"\n-                      ", 1 given")\n-        return space.w_Null\n+    w_arr.appenditem_inplace(space, w_value1)\n     for w_arg in args_w:\n         w_arr.appenditem_inplace(space, w_arg)\n     return space.wrap(w_arr.arraylen())\n@@ -1395,8 +1392,8 @@ def array_unique(space, w_arr, sort_type=0):\n     return space.new_array_from_rdict(d)\n \n \n-@wrap([\'space\', \'reference\', \'args_w\'])\n-def array_unshift(space, w_ref, args_w):\n+@wrap([\'space\', \'reference\', W_Root, \'args_w\'])\n+def array_unshift(space, w_ref, w_value1, args_w):\n     """ Prepend one or more elements to the beginning of an array """\n     w_arr = w_ref.deref()\n     if w_arr.tp != space.tp_array:\n@@ -1404,7 +1401,10 @@ def array_unshift(space, w_ref, args_w):\n                       "to be array, %s given"\n                       % space.get_type_name(w_arr.tp))\n         return space.w_Null\n-    new_arr = space.new_array_from_list(args_w)\n+    args = newlist_hint(len(args_w) + 1)\n+    args.append(w_value1)\n+    args.extend(args_w)\n+    new_arr = space.new_array_from_list(args)\n     with space.iter(w_arr) as w_arr_iter:\n         while not w_arr_iter.done():\n             w_key, w_val = w_arr_iter.next_item(space)\n@@ -1922,7 +1922,7 @@ def rsort(space, w_ref, sort_type=0):\n     return space.w_True\n \n \n-@wrap([\'space\', \'reference\'])\n+@wrap([\'space\', \'reference\'], error=False)\n def shuffle(space, w_ref):\n     """ Shuffle an array """\n     w_arr = w_ref.deref()\ndiff --git a/hippy/module/standard/exec_.py b/hippy/module/standard/exec_.py\nindex f3a4ac3d..48e5648d 100644\n--- a/hippy/module/standard/exec_.py\n+++ b/hippy/module/standard/exec_.py\n@@ -1,6 +1,8 @@\n-\n-from hippy.builtin import wrap\n from rpython.rlib.rstring import StringBuilder\n+from rpython.rlib.rfile import create_popen_file\n+\n+from hippy.objects.nullobject import w_Null\n+from hippy.builtin import wrap, Optional, ExitFunctionWithError\n \n \n @wrap([\'interp\', str])\n@@ -19,7 +21,88 @@ def escapeshellarg(interp, arg):\n     return interp.space.wrap(s.build())\n \n \n+@wrap([\'interp\', str, Optional(\'reference\'), Optional(\'reference\')],\n+      error=False, name=\'exec\')\n+def exec_(interp, cmd, r_output=None, r_return_var=None):\n+    space = interp.space\n+    if not cmd:\n+        raise ExitFunctionWithError(\'Cannot execute a blank command\')\n+    if r_output is not None:\n+        if not space.is_array(r_output.deref_temp()):\n+            r_output.store(space.new_array_from_list([]))\n+        w_output = r_output.deref_unique()\n+    else:\n+        w_output = None\n+    try:\n+        pfile = create_popen_file(cmd, \'r\')\n+    except OSError:\n+        raise ExitFunctionWithError(\'Unable to fork [%s]\' % cmd, w_Null)\n+    last_line = \'\'\n+    while True:\n+        line = pfile.readline()\n+        if not line:\n+            break\n+        last_line = line.rstrip()\n+        if w_output:\n+            w_output.appenditem_inplace(space, space.newstr(last_line))\n+    exitcode = pfile.close()\n+    if r_return_var is not None:\n+        r_return_var.store(space.wrap(exitcode))\n+    return space.newstr(last_line)\n+\n+\n+@wrap([\'interp\', str, Optional(\'reference\')], error=False)\n+def passthru(interp, cmd, r_return_var=None):\n+    space = interp.space\n+    if not cmd:\n+        raise ExitFunctionWithError(\'Cannot execute a blank command\')\n+    try:\n+        pfile = create_popen_file(cmd, \'r\')\n+    except OSError:\n+        raise ExitFunctionWithError(\'Unable to fork [%s]\' % cmd, w_Null)\n+    last_line = \'\'\n+    while True:\n+        line = pfile.read()\n+        if not line:\n+            break\n+        interp.writestr(line, buffer=False)\n+    exitcode = pfile.close()\n+    if r_return_var is not None:\n+        r_return_var.store(space.wrap(exitcode))\n+    return space.newstr(last_line)\n+\n+\n+@wrap([\'interp\', str, Optional(\'reference\')], error=False)\n+def system(interp, cmd, r_return_var=None):\n+    space = interp.space\n+    if not cmd:\n+        raise ExitFunctionWithError(\'Cannot execute a blank command\')\n+    try:\n+        pfile = create_popen_file(cmd, \'r\')\n+    except OSError:\n+        raise ExitFunctionWithError(\'Unable to fork [%s]\' % cmd, w_Null)\n+    last_line = \'\'\n+    while True:\n+        line = pfile.readline()\n+        if not line:\n+            break\n+        interp.writestr(line, buffer=True)\n+        last_line = line\n+    exitcode = pfile.close()\n+    if r_return_var is not None:\n+        r_return_var.store(space.wrap(exitcode))\n+    return space.newstr(last_line.rstrip())\n+\n+\n @wrap([\'interp\', str])\n-def passthru(interp, cmd):\n-    interp.warn("passthru not implemented")\n-    return interp.space.w_False\n+def shell_exec(interp, cmd):\n+    try:\n+        r_pfile = create_popen_file(cmd, \'r\')\n+    except OSError:\n+        interp.warn("Unable to execute \'%s\'" % cmd)\n+        return w_Null\n+    res = r_pfile.read(-1)\n+    if res:\n+        return interp.space.wrap(res)\n+    else:\n+        return w_Null\ndiff --git a/hippy/module/standard/file/funcs.py b/hippy/module/standard/file/funcs.py\nindex 0eb05dd8..ba3520ca 100644\n--- a/hippy/module/standard/file/funcs.py\n+++ b/hippy/module/standard/file/funcs.py\n@@ -794,7 +794,7 @@ def _parse_wrapper(fname):\n     return fname, read_filters, write_filters\n \n \n-def _fopen(space, fname, mode, w_use_include_path=False, w_ctx=None):\n+def _fopen(space, fname, mode, use_include_path=False, w_ctx=None):\n     fname, read_filters, write_filters = _parse_wrapper(fname)\n \n     if fname == "" or fname is None:\n@@ -804,8 +804,8 @@ def _fopen(space, fname, mode, w_use_include_path=False, w_ctx=None):\n         raise FopenError(["expects parameter 1 to be a "\n                           "valid path, string given"])\n \n-    if w_use_include_path:\n-        fname = space.bytecode_cache._find_file(space.ec.interpreter, fname)\n+    if use_include_path:\n+        fname = space.ec.interpreter.find_file(fname)\n \n     if mode.startswith("x"):\n         if rpath.exists(fname):\n@@ -827,7 +827,7 @@ def _fopen(space, fname, mode, w_use_include_path=False, w_ctx=None):\n \n @wrap([\'space\', FilenameArg(False), str, Optional(BoolArg(False)),\n        Optional(StreamContextArg(False))], error=False)\n-def fopen(space, fname, mode, w_use_include_path=False, w_ctx=None):\n+def fopen(space, fname, mode, use_include_path=False, w_ctx=None):\n     """ fopen - Opens file or URL """\n     if not is_in_basedir(space, \'fopen\', fname):\n         space.ec.warn("fopen(%s): failed to open stream: "\n@@ -835,7 +835,7 @@ def fopen(space, fname, mode, w_use_include_path=False, w_ctx=None):\n         return space.w_False\n \n     try:\n-        return _fopen(space, fname, mode, w_use_include_path, w_ctx)\n+        return _fopen(space, fname, mode, use_include_path, w_ctx)\n     except FopenError as e:\n         for r in e.reasons:\n             space.ec.warn("fopen(%s): %s" % (fname, r))\ndiff --git a/hippy/module/standard/misc/funcs.py b/hippy/module/standard/misc/funcs.py\nindex 5923b7cb..48058a7c 100644\n--- a/hippy/module/standard/misc/funcs.py\n+++ b/hippy/module/standard/misc/funcs.py\n@@ -117,11 +117,17 @@ def show_source():\n     return NotImplementedError()\n \n \n-@wrap([\'interp\', int])\n+@wrap([\'interp\', int], error=False)\n def sleep(interp, seconds):\n     """ Delay execution"""\n+    if seconds < 0:\n+        interp.warn("sleep(): Number of seconds must be greater than or equal to 0")\n+        return interp.space.w_False\n+\n     import time\n     time.sleep(seconds)\n+    # TODO: when a signal is received and a handler is defined, the remaining\n+    # number of seconds as float should be returned.\n     return interp.space.newint(0)\n \n \n@@ -172,6 +178,12 @@ def unpack():\n     return NotImplementedError()\n \n \n-def usleep():\n+@wrap([\'interp\', int])\n+def usleep(interp, microseconds):\n     """ Delay execution in microseconds"""\n-    return NotImplementedError()\n+    if microseconds < 0:\n+        interp.warn("usleep(): Number of microseconds must be greater than or equal to 0")\n+        return interp.space.w_False\n+\n+    import time\n+    time.sleep(microseconds / 1000000.0)\ndiff --git a/hippy/module/standard/strings/funcs.py b/hippy/module/standard/strings/funcs.py\nindex 82be8cf0..cddc2606 100644\n--- a/hippy/module/standard/strings/funcs.py\n+++ b/hippy/module/standard/strings/funcs.py\n@@ -5,6 +5,7 @@ from rpython.rlib.rstring import StringBuilder\n from rpython.rlib import jit\n from rpython.rlib.unroll import unrolling_iterable\n from rpython.rlib import rmd5\n+from rpython.rlib.objectmodel import newlist_hint\n from rpython.rlib.objectmodel import specialize\n from rpython.rlib.rsha import sha\n \n@@ -21,6 +22,7 @@ from rpython.rlib.rfloat import DTSF_CUT_EXP_0\n from rpython.rlib.rarithmetic import r_uint\n from hippy.objects.convert import strtol\n from rpython.rlib.rarithmetic import intmask, ovfcheck\n+from rpython.rlib.rrandom import Random\n from hippy.module.standard.math.funcs import _bin\n from hippy.module.url import _urldecode\n \n@@ -28,6 +30,9 @@ from hippy.module.url import _urldecode\n from hippy import localemodule as locale\n \n \n+_random = Random()\n+\n+\n class ValidationError(ExitFunctionWithError):\n     """Raised when a PHP function gets wrong arguments"""\n     def __init__(self, msg="Bad arguments", return_value=None):\n@@ -518,13 +523,95 @@ def count_chars(interp, s, mode=0):\n         return space.wrap("".join(res))\n     assert False # unreachable code\n \n-#\n-#@wrap([\'space\', \'args_w\'])\n-#def crc32(space, args_w):\n-#    """Calculates the crc32 polynomial of a string."""\n-#    raise NotImplementedError()\n \n-#\n+# Table taken from PHP\'s ext/standard/crc32.h\n+_crc32tab = [\n+    0x00000000, 0x77073096, 0xee0e612c, 0x990951ba,\n+    0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3,\n+    0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988,\n+    0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91,\n+    0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de,\n+    0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7,\n+    0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec,\n+    0x14015c4f, 0x63066cd9, 0xfa0f3d63, 0x8d080df5,\n+    0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172,\n+    0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b,\n+    0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940,\n+    0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59,\n+    0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116,\n+    0x21b4f4b5, 0x56b3c423, 0xcfba9599, 0xb8bda50f,\n+    0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924,\n+    0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d,\n+    0x76dc4190, 0x01db7106, 0x98d220bc, 0xefd5102a,\n+    0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433,\n+    0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818,\n+    0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01,\n+    0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e,\n+    0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457,\n+    0x65b0d9c6, 0x12b7e950, 0x8bbeb8ea, 0xfcb9887c,\n+    0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65,\n+    0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2,\n+    0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb,\n+    0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0,\n+    0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9,\n+    0x5005713c, 0x270241aa, 0xbe0b1010, 0xc90c2086,\n+    0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f,\n+    0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4,\n+    0x59b33d17, 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad,\n+    0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a,\n+    0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683,\n+    0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8,\n+    0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1,\n+    0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe,\n+    0xf762575d, 0x806567cb, 0x196c3671, 0x6e6b06e7,\n+    0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc,\n+    0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5,\n+    0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252,\n+    0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b,\n+    0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60,\n+    0xdf60efc3, 0xa867df55, 0x316e8eef, 0x4669be79,\n+    0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236,\n+    0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f,\n+    0xc5ba3bbe, 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04,\n+    0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d,\n+    0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a,\n+    0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713,\n+    0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38,\n+    0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21,\n+    0x86d3d2d4, 0xf1d4e242, 0x68ddb3f8, 0x1fda836e,\n+    0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777,\n+    0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c,\n+    0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45,\n+    0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2,\n+    0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db,\n+    0xaed16a4a, 0xd9d65adc, 0x40df0b66, 0x37d83bf0,\n+    0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9,\n+    0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6,\n+    0xbad03605, 0xcdd70693, 0x54de5729, 0x23d967bf,\n+    0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94,\n+    0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d,\n+]\n+\n+\n+@wrap([\'space\', str])\n+def crc32(space, data):\n+    """Calculates the crc32 polynomial of a string."""\n+    # Implementation based on PHP\'s ext/standard/crc32.h\n+    crc = 0xFFFFFFFF\n+    for c in data:\n+        crc = ((crc >> 8) & 0x00FFFFFF) ^ _crc32tab[(crc ^ ord(c)) & 0xFF]\n+    crc ^= 0xFFFFFFFF\n+\n+    # PHP returns a value that depends on the platform. On 32 bits systems the\n+    # value is in the range [-2**31, 2**31-1] but on 64 bits systems it is in\n+    # the range [0, 2**32-1].\n+    # See http://php.net//manual/en/function.crc32.php\n+    if sys.maxint < 2 ** 31 and crc >= 2 ** 31:  # 32 bits\n+        return space.newint(crc - 2 ** 32)\n+    else:\n+        return space.newint(crc)\n+\n+\n #@wrap([\'space\', \'args_w\'])\n #def crypt(space, args_w):\n #    """One-way string hashing."""\n@@ -594,10 +681,22 @@ def fprintf(space, args_w):\n #    """Convert logical Hebrew text to visual text with newline conversion."""\n #    raise NotImplementedError()\n \n-#@wrap([\'space\', \'args_w\'])\n-#def hex2bin(space, args_w):\n-#    """Decodes a hexadecimally encoded binary string."""\n-#    raise NotImplementedError()\n+\n+@wrap([\'space\', str])\n+def hex2bin(space, data):\n+    """Decodes a hexadecimally encoded binary string."""\n+    if len(data) % 2 != 0:\n+        space.ec.warn("hex2bin(): Hexadecimal input string must have an even length")\n+        return space.w_False\n+\n+    builder = StringBuilder(len(data) / 2)\n+    for i in xrange(0, len(data), 2):\n+        if not is_hexdigit(data[i]) or not is_hexdigit(data[i + 1]):\n+            return space.w_False\n+        char = chr(hexdigit(data[i]) << 4 | hexdigit(data[i + 1]))\n+        builder.append(char)\n+\n+    return space.newstr(builder.build())\n \n \n @wrap([\'space\',   str,   Optional(int),   Optional(str)])\n@@ -874,13 +973,60 @@ def lcfirst(space, string):\n     s = builder.build()\n     return space.newstr(s)\n \n-#\n-#@wrap([\'space\', \'args_w\'])\n-#def levenshtein(space, args_w):\n-#    """Calculate Levenshtein distance between two strings."""\n-#    raise NotImplementedError()\n \n-#\n+@wrap([\'space\', \'num_args\', Optional(str), Optional(str), Optional(W_Root), Optional(int), Optional(int)], check_num_args=False)\n+def levenshtein(space, num_args, str1=\'\', str2=\'\', w_cost_ins=None, cost_rep=1, cost_del=1):\n+    """Calculate Levenshtein distance between two strings."""\n+    # Code based on ext/standard/levenshtein.c\n+    # check_num_args is set to False because levenshtein always shows a custom\n+    # warning message when the number of arguments is incorrect.\n+    if num_args == 3:\n+        space.ec.warn(\'levenshtein(): The general Levenshtein support is not there yet\')\n+        return space.newint(-1)\n+    elif num_args not in (2, 5):\n+        space.ec.warn(\'Wrong parameter count for levenshtein()\')\n+        return space.w_Null\n+\n+    cost_ins = 1\n+    # levenshtein first shows the warning for the general function first and\n+    # then checks if the argument is valid. So we have to do parse it manually\n+    # here.\n+    if num_args == 5:\n+        try:\n+            cost_ins = w_cost_ins.as_int_arg(space)\n+        except ConvertError:\n+            space.ec.warn(\'levenshtein() expects parameter 3 to be long, %s given\' % w_cost_ins.tp)\n+            return space.w_Null\n+\n+    if len(str1) > 255 or len(str2) > 255:\n+        space.ec.warn(\'levenshtein(): Argument string(s) too long\')\n+        return space.newint(-1)\n+\n+    if not str1:\n+        return space.newint(len(str2) * cost_ins)\n+    if not str2:\n+        return space.newint(len(str1) * cost_del)\n+    if str1 == str2:\n+        return space.newint(0)\n+\n+    p1 = range(0, (len(str2) + 1) * cost_ins, cost_ins)\n+    p2 = [0] * (len(str2) + 1)\n+\n+    for i in xrange(len(str1)):\n+        p2[0] = p1[0] + cost_del\n+        for j in xrange(len(str2)):\n+            c0 = p1[j]\n+            if str1[i] != str2[j]:\n+                c0 += cost_rep\n+            c1 = p1[j + 1] + cost_del\n+            c2 = p2[j] + cost_ins\n+            # Rpython only allow two arguments to min\n+            p2[j + 1] = min(c0, min(c1, c2))\n+        p1, p2 = p2, p1\n+\n+    return space.newint(p1[-1])\n+\n+\n #@wrap([\'space\', \'args_w\'])\n #def md5_file(space, args_w):\n #    """Calculates the md5 hash of a given file."""\n@@ -1361,17 +1507,110 @@ def vsprintf(space, w_obj, w_args):\n         space.ec.warn("vsprintf(): " + e.msg)\n         return space.w_False\n \n-#\n-#@wrap([\'space\', \'args_w\'])\n-#def quoted_printable_decode(space, args_w):\n-#    """Convert a quoted-printable string to an 8 bit string."""\n-#    raise NotImplementedError()\n \n-#\n-#@wrap([\'space\', \'args_w\'])\n-#def quoted_printable_encode(space, args_w):\n-#    """Convert a 8 bit string to a quoted-printable string."""\n-#    raise NotImplementedError()\n+@wrap([\'space\', str])\n+def quoted_printable_decode(space, data):\n+    """Convert a quoted-printable string to an 8 bit string."""\n+    builder = StringBuilder(len(data))\n+    i = 0\n+    while i < len(data):\n+        c = data[i]\n+        if c == \'=\':\n+            next_two_chars = data[i + 1: i + 3]\n+            if (i + 2 < len(data) and\n+                    is_hexdigit(data[i + 1]) and is_hexdigit(data[i + 2])):\n+                hex_char = hexdigit(data[i + 1]) << 4 | hexdigit(data[i + 2])\n+                builder.append(chr(hex_char))\n+                i += 3\n+            else:\n+                k = 1\n+                # Skip spaces and tabs\n+                while i + k < len(data) and data[i + k] in \' \\t\':\n+                    k += 1\n+                if data[i + k: i + k + 2] == \'\\r\\n\':\n+                    i += k + 2\n+                elif data[i + k] in \'\\n\\r\':\n+                    i += k + 1\n+                else:\n+                    builder.append(c)\n+                    i += 1\n+        else:\n+            builder.append(c)\n+            i += 1\n+\n+    return space.newstr(builder.build())\n+\n+\n+def _add_data(builder, line_length, data, extra_length=0):\n+    max_length = 75\n+    length = len(data)\n+    if line_length + length + extra_length > max_length:\n+        builder.append(\'=\\r\\n\')\n+        builder.append(data)\n+        return length\n+    else:\n+        builder.append(data)\n+        return line_length + length\n+\n+\n+def _to_hex(value):\n+    # TODO: refactor this as it could be used in bin2hex. Although there they\n+    # require lowercase digits.\n+    encode = \'0123456789ABCDEF\'\n+    hi, low = value // 16, value % 16\n+    return encode[hi] + encode[low]\n+\n+\n+@wrap([\'space\', str])\n+def quoted_printable_encode(space, data):\n+    """Convert a 8 bit string to a quoted-printable string."""\n+    builder = StringBuilder(int(3 * len(data) * (1 + 3.0 / 75)))\n+    pending_cr = False\n+    pending_space = False\n+    line_length = 0\n+    for c in data:\n+        value = ord(c)\n+        if pending_cr:\n+            if c == \'\\n\':\n+                builder.append(\'\\r\\n\')\n+                line_length = 0\n+                pending_cr = False\n+                continue\n+            else:\n+                line_length = _add_data(builder, line_length, \'=0D\')\n+        if pending_space:\n+            if c == \'\\r\':\n+                line_length = _add_data(builder, line_length, \'=20\')\n+            else:\n+                line_length = _add_data(builder, line_length, \' \')\n+        pending_cr = False\n+        pending_space = False\n+        if value == 61:\n+            line_length = _add_data(builder, line_length, \'=3D\')\n+        elif 33 <= value <= 126:\n+            line_length = _add_data(builder, line_length, c)\n+        elif c == \'\\r\':\n+            pending_cr = True\n+        elif c == \' \':\n+            pending_space = True\n+        else:\n+            # This hack is specific to PHP, so that the output is the same.\n+            extra_length = 0\n+            if value > 0x7f:\n+                extra_length += 3\n+            if value > 0xdf:\n+                extra_length += 3\n+            if value > 0xef:\n+                extra_length += 3\n+            line_length = _add_data(builder, line_length, \'=\' + _to_hex(value),\n+                                    extra_length=extra_length)\n+\n+    if pending_cr:\n+        line_length = _add_data(builder, line_length, \'=0D\')\n+    if pending_space:\n+        line_length = _add_data(builder, line_length, \' \')\n+\n+    return space.newstr(builder.build())\n \n \n @wrap([\'space\', str])\n@@ -1410,13 +1649,48 @@ def sha1(space, s, raw_output=False):\n #    """Calculate the similarity between two strings."""\n #    raise NotImplementedError()\n \n-#\n-#@wrap([\'space\', \'args_w\'])\n-#def soundex(space, args_w):\n-#    """Calculate the soundex key of a string."""\n-#    raise NotImplementedError()\n \n-#\n+@wrap([\'space\', str])\n+def soundex(space, data):\n+    """Calculate the soundex key of a string."""\n+    #                ABCDEFGHIJKLMNOPQRSTUVWXYZ\n+    soundex_table = \'01230120022455012623010202\'\n+\n+    if not data:\n+        return space.w_False\n+\n+    # build soundex string\n+    soundex_data = [\'0\'] * 4\n+\n+    data = data.upper()\n+    last_code = None\n+    i = 0\n+    for letter in data:\n+        # Strip non-letter chars\n+        # BUG: should also map here accented letters used in non\n+        # English words or names (also found in English text!):\n+        # esstsett, thorn, n-tilde, c-cedilla, s-caron, ...\n+        if \'A\' <= letter <= \'Z\':\n+            code = soundex_table[ord(letter) - ord(\'A\')]\n+            if i == 0:\n+                # remember first valid char\n+                soundex_data[i] = letter\n+                i += 1\n+                last_code = code\n+            elif code != last_code:\n+                # ignore sequences of consonants with same soundex\n+                # code in trail, and vowels unless they separate\n+                # consonant letters\n+                if code != \'0\':\n+                    soundex_data[i] = code\n+                    i += 1\n+                    if i == 4:\n+                        break\n+                last_code = code\n+\n+    return space.newstr(\'\'.join(soundex_data))\n+\n+\n #@wrap([\'space\', \'args_w\'])\n #def sscanf(space, args_w):\n #    """Parses input from a string according to a format."""\n@@ -1473,6 +1747,9 @@ def str_pad(space, input, pad_length, pad_string=" ", pad_type=STR_PAD_RIGHT):\n @wrap([\'space\', str, int])\n def str_repeat(space, s, repeat):\n     """Repeat a string."""\n+    if repeat < 0:\n+        space.ec.warn(\'str_repeat(): Second argument has to be greater than or equal to 0\')\n+        return space.w_Null\n     return space.newstr(s * repeat)\n \n \n@@ -1587,13 +1864,18 @@ def str_rot13(space, string):\n     """Perform the rot13 transform on a string."""\n     return space.newstr(_str_rot13(string))\n \n-#\n-#@wrap([\'space\', \'args_w\'])\n-#def str_shuffle(space, args_w):\n-#    """Randomly shuffles a string."""\n-#    raise NotImplementedError()\n \n-#\n+@wrap([\'space\', str])\n+def str_shuffle(space, data):\n+    """Randomly shuffles a string."""\n+    chars = newlist_hint(len(data))\n+    for c in data:\n+        chars.append(c)\n+    # TODO: refactor this logic as it is copied from array/funcs.py:shuffle.\n+    for i in xrange(len(chars) - 1, 0, -1):\n+        j = int(_random.random() * (i + 1))\n+        chars[i], chars[j] = chars[j], chars[i]\n+    return space.newstr(\'\'.join(chars))\n \n \n @wrap([\'interp\', str, Optional(int)])\n@@ -1690,7 +1972,7 @@ def stristr(space, haystack, w_needle, before_needle=False):\n         space.ec.warn("stristr(): " + exc.msg)\n         return space.w_False\n     if len(needle) == 0:\n-        space.ec.warn("stristr(): Empty delimiter")\n+        space.ec.warn("stristr(): Empty needle")\n         return space.w_False\n     needle = locale.lower(needle)\n     hay_lower = locale.lower(haystack)\n@@ -1894,7 +2176,7 @@ def strpos(space, haystack, w_needle, offset=0):\n         space.ec.warn("strpos(): " + exc.msg)\n         return space.w_False\n     if len(needle) == 0:\n-        space.ec.warn("strpos(): Empty delimiter")\n+        space.ec.warn("strpos(): Empty needle")\n         return space.w_False\n \n     result = haystack.find(needle, offset)\n@@ -2024,7 +2306,7 @@ def strstr(space, haystack, w_needle, before_needle=False):\n         space.ec.warn("strstr(): " + exc.msg)\n         return space.w_False\n     if len(needle) == 0:\n-        space.ec.warn("strstr(): Empty delimiter")\n+        space.ec.warn("strstr(): Empty needle")\n         return space.w_False\n     pos = haystack.find(needle)\n     if pos < 0:\ndiff --git a/hippy/objects/arrayobject.py b/hippy/objects/arrayobject.py\nindex dc97e38c..0fd8f358 100644\n--- a/hippy/objects/arrayobject.py\n+++ b/hippy/objects/arrayobject.py\n@@ -2,10 +2,12 @@\n from rpython.rlib import jit\n from rpython.rlib.objectmodel import specialize, we_are_translated\n from rpython.rlib.rarithmetic import intmask\n+from rpython.rlib.rstring import replace\n \n from hippy.objects.base import W_Object\n from hippy.objects.reference import W_Reference, VirtualReference\n from hippy.objects.convert import force_float_to_int_in_any_way\n+from hippy.objects.strobject import string_var_export\n from hippy.error import ConvertError\n from collections import OrderedDict\n from rpython.rlib.rstring import StringBuilder\n@@ -805,9 +807,6 @@ def array_var_export(dct_w, space, indent, recursion, w_reckey,\n         # case where atrrib is protected...\n         if key.startswith(\'\\x00\') and len(key) > 1:\n             key = key[3:]\n-        # case where key is \\x00 .....\n-        if key == \'\\x00\':\n-            key = \'\\\' . \\"\\\\0\\" . \\\'\'\n         if w_value is w_reckey:\n             # space.ec.error("Nesting level too deep - recursive dependency?")\n             space.ec.warn("var_export does not handle circular references")\n@@ -817,7 +816,8 @@ def array_var_export(dct_w, space, indent, recursion, w_reckey,\n             index = try_convert_str_to_int(key)\n             s = \'%s%d =>\' % (subindent, index)\n         except ValueError:\n-            s = \'%s\\\'%s\\\' =>\' % (subindent, key)\n+            key = string_var_export(key)\n+            s = \'%s%s =>\' % (subindent, key)\n \n         acc.append(s)\n         if isinstance(w_value, W_ArrayObject):\ndiff --git a/hippy/objects/instanceobject.py b/hippy/objects/instanceobject.py\nindex 036b2ab1..064295a1 100644\n--- a/hippy/objects/instanceobject.py\n+++ b/hippy/objects/instanceobject.py\n@@ -208,7 +208,14 @@ class W_InstanceObject(W_Object):\n     def var_export(self, space, indent, recursion, suffix):\n         header = \'%s::__set_state(array\' % (self.getclass().name)\n         dct_w = self.get_instance_attrs()\n-        return array_var_export(dct_w, space,\n+        clean_dct_w = OrderedDict()\n+        for key, value in dct_w.iteritems():\n+            last_null_pos = key.rfind(\'\\x00\')\n+            if last_null_pos >= 0:\n+                key = key[last_null_pos + 1:]\n+            clean_dct_w[key] = value\n+\n+        return array_var_export(clean_dct_w, space,\n                                 indent, recursion,\n                                 self, header, suffix=suffix, prefix=\'\')\n \ndiff --git a/hippy/objects/resources/file_resource.py b/hippy/objects/resources/file_resource.py\nindex 0de6fc4a..d979e254 100644\n--- a/hippy/objects/resources/file_resource.py\n+++ b/hippy/objects/resources/file_resource.py\n@@ -2,7 +2,7 @@ import os\n from hippy.objects.resources import W_Resource\n from rpython.rlib.rStringIO import RStringIO\n from rpython.rlib.rfile import RFile\n-from rpython.rlib.objectmodel import import_from_mixin\n+from rpython.rlib.objectmodel import import_from_mixin, enforceargs\n from collections import OrderedDict\n \n \n@@ -71,6 +71,7 @@ class W_FileResource(W_Resource):\n         except IOError:\n             return False\n \n+    @enforceargs(None, str, None)\n     def do_filter(self, data, direction):\n         from hippy.module.standard.strings.funcs import _str_rot13\n         from hippy.module.standard.strings.funcs import _chunk_split\n@@ -111,11 +112,13 @@ class W_FileResource(W_Resource):\n \n     def read(self, size=1024):\n         data = self.resource.read(size)\n+        assert data is not None\n         data = self.do_filter(data, READ)\n         if len(data) < size:\n             self.eof = True\n         return data\n \n+    @enforceargs(None, str, int)\n     def write(self, data, length):\n         if length <= 0:\n             return 0\n@@ -124,6 +127,7 @@ class W_FileResource(W_Resource):\n         self.cur_line_no += towrite.count(os.linesep)\n         return min(length, len(data))\n \n+    @enforceargs(None, str)\n     def writeall(self, data):\n         towrite = self.do_filter(data, WRITE)\n         self.resource.write(towrite)\n@@ -131,6 +135,7 @@ class W_FileResource(W_Resource):\n \n     def passthru(self):\n         res = self.resource.read(-1)\n+        assert res is not None\n         res = self.do_filter(res, READ)\n         self.space.ec.interpreter.writestr(res)\n         return len(res)\ndiff --git a/hippy/objects/resources/socket_resource.py b/hippy/objects/resources/socket_resource.py\nindex e14e3bbf..dc8439c2 100644\n--- a/hippy/objects/resources/socket_resource.py\n+++ b/hippy/objects/resources/socket_resource.py\n@@ -1,12 +1,12 @@\n import os\n-from hippy.objects.resources import W_Resource\n-from hippy.objects.resources.file_resource import W_FileResource\n-from rpython.rlib.rsocket import RSocket, SOCK_DGRAM, SOCK_STREAM\n-from rpython.rlib.rsocket import INETAddress\n-from rpython.rlib.rsocket import SocketTimeout\n-from rpython.rlib.rsocket import CSocketError\n from collections import OrderedDict\n+from rpython.rlib.rsocket import (\n+    RSocket, SOCK_DGRAM, SOCK_STREAM, INETAddress, SocketTimeout, CSocketError)\n from rpython.rlib.rstring import StringBuilder\n+from rpython.rlib.objectmodel import enforceargs\n+\n+from hippy.objects.resources import W_Resource\n+from hippy.objects.resources.file_resource import W_FileResource\n \n \n CLOSE, OPEN, NONE = range(3)\n@@ -86,6 +86,7 @@ class W_SocketResource(W_FileResource):\n         except IOError:\n             return False\n \n+    @enforceargs(None, str, None)\n     def do_filter(self, data, direction):\n         from hippy.module.standard.strings.funcs import _str_rot13\n         from hippy.module.standard.strings.funcs import _chunk_split\n@@ -130,11 +131,13 @@ class W_SocketResource(W_FileResource):\n         except (SocketTimeout, CSocketError):\n             self.timed_out = True\n             return ""\n+        assert data is not None\n         data = self.do_filter(data, READ)\n         if len(data) < size:\n             self.eof = True\n         return data\n \n+    @enforceargs(None, str, int)\n     def write(self, data, length):\n         if length <= 0:\n             return 0\n@@ -144,6 +147,7 @@ class W_SocketResource(W_FileResource):\n         self.cur_line_no += towrite.count(os.linesep)\n         return min(length, len(data))\n \n+    @enforceargs(None, str)\n     def writeall(self, data):\n         towrite = self.do_filter(data, WRITE)\n         assert towrite is not None\ndiff --git a/hippy/objects/strobject.py b/hippy/objects/strobject.py\nindex 5b121757..ed08a471 100644\n--- a/hippy/objects/strobject.py\n+++ b/hippy/objects/strobject.py\n@@ -1,7 +1,7 @@\n import struct\n \n from rpython.rlib.objectmodel import compute_hash\n-from rpython.rlib.rstring import StringBuilder\n+from rpython.rlib.rstring import StringBuilder, replace\n from hippy.objects.base import W_Object\n from hippy.objects.reference import VirtualReference\n from hippy.objects.convert import convert_string_to_number, strtol\n@@ -179,7 +179,9 @@ class W_StringObject(W_Object):\n \n     def var_export(self, space, indent, recursion, suffix):\n         s = self.unwrap()\n-        return \'%s\\\'%s\\\'%s\' % (indent, s, suffix)\n+        s = string_var_export(s)\n+\n+        return \'%s%s%s\' % (indent, s, suffix)\n \n     def is_empty_value(self):\n         return self.strlen() == 0\n@@ -419,4 +421,16 @@ def single_char_string(c):\n     assert len(c) == 1\n     return W_ConstStringObject(c)\n \n+\n+def string_var_export(string):\n+    assert string is not None\n+    parts = string.split(\'\\x00\')\n+    escaped_parts = []\n+    for part in parts:\n+        escaped_part = "\'%s\'" % replace(replace(part, \'\\\\\', \'\\\\\\\\\'), "\'", "\\\\\'")\n+        escaped_parts.append(escaped_part)\n+\n+    return \' . "\\\\0" . \'.join(escaped_parts)\n+\n+\n EMPTY_STRING = W_ConstStringObject("")\ndiff --git a/hippy/objspace.py b/hippy/objspace.py\nindex d4cab287..1402e982 100644\n--- a/hippy/objspace.py\n+++ b/hippy/objspace.py\n@@ -62,6 +62,11 @@ class ExecutionContext(object):\n         self.initialized = True\n         rsignal.pypysig_setflag(signal.SIGINT)\n \n+    def clear_signals(self):\n+        rsignal.pypysig_getaddr_occurred().c_value = 0\n+        rsignal.pypysig_default(signal.SIGINT)\n+        self.initialized = False\n+\n     def notice(self, msg):\n         self.interpreter.notice(msg)\n \n@@ -108,13 +113,13 @@ class ObjSpace(object):\n     (tp_int, tp_float, tp_str, tp_array, tp_null, tp_bool,\n      tp_object, tp_file_res, tp_dir_res, tp_stream_context,\n      tp_mysql_link, tp_mysql_result,\n-     tp_constant, tp_delayed_class_const, tp_xmlparser_res) = range(15)\n+     tp_constant, tp_delayed_class_const, tp_xmlparser_res, tp_mcrypt_res) = range(16)\n \n     # in the same order as the types above\n     TYPENAMES = ["integer", "double", "string", "array", "NULL", "boolean",\n                  "object", "resource", "resource", "resource",\n                  "resource", "resource", "constant", "delayed constant",\n-                 "resource"]\n+                 "resource", "resource"]\n \n     w_True = w_True\n     w_False = w_False\n@@ -958,5 +963,9 @@ if is_optional_extension_enabled("xml"):\n     from ext_module.xml.xmlparser import XMLParserResource\n     XMLParserResource.tp = ObjSpace.tp_xmlparser_res\n \n+if is_optional_extension_enabled("mcrypt"):\n+    from ext_module.mcrypt.mcrypt_resource import W_McryptResource\n+    W_McryptResource.tp = ObjSpace.tp_mcrypt_res\n+\n W_Constant.tp = ObjSpace.tp_constant\n DelayedClassConstant.tp = ObjSpace.tp_delayed_class_const\ndiff --git a/hippy/rpwd.py b/hippy/rpwd.py\nindex c8d72654..a2107c09 100644\n--- a/hippy/rpwd.py\n+++ b/hippy/rpwd.py\n@@ -18,8 +18,16 @@ class CConfig(object):\n                               (\'pw_dir\', rffi.CCHARP),\n                               (\'pw_shell\', rffi.CCHARP)])\n \n+    group = platform.Struct(\'struct group\',\n+                            [(\'gr_name\', rffi.CCHARP),\n+                             (\'gr_passwd\', rffi.CCHARP),\n+                             (\'gr_gid\', lltype.Signed),\n+                             (\'gr_mem\', rffi.CCHARPP)])\n+\n PASSWD = platform.configure(CConfig)[\'passwd\']\n PASSWDPTR = lltype.Ptr(PASSWD)\n+GROUP =  platform.configure(CConfig)[\'group\']\n+GROUPPTR = lltype.Ptr(GROUP)\n \n getpwnam = rffi.llexternal(\'getpwnam\', [rffi.CCHARP], PASSWDPTR,\n                            compilation_info=eci)\n@@ -27,3 +35,7 @@ getpwuid = rffi.llexternal(\'getpwuid\', [lltype.Signed], PASSWDPTR,\n                            compilation_info=eci)\n initgroups = rffi.llexternal(\'initgroups\', [rffi.CCHARP, lltype.Signed],\n                              rffi.INT, compilation_info=eci)\n+getgrgid = rffi.llexternal(\'getgrgid\', [lltype.Signed], GROUPPTR,\n+                           compilation_info=eci)\n+getgrnam = rffi.llexternal(\'getgrnam\', [rffi.CCHARP], GROUPPTR,\n+                           compilation_info=eci)\ndiff --git a/hippy/sourceparser.py b/hippy/sourceparser.py\nindex 7dc492ba..20558723 100644\n--- a/hippy/sourceparser.py\n+++ b/hippy/sourceparser.py\n@@ -2105,9 +2105,13 @@ class SourceParser(BaseParser):\n             s = s[:pos]\n         if len(s) > 20:\n             s = s[:17] + "..."\n-        raise ParseError("syntax error, unexpected \\\'%s\\\' (%s), in file %s" %\n-                         (s, token.name, self.filename),\n-                         token.getsourcepos())\n+        if token.name == s:\n+            message = ("syntax error, unexpected \\\'%s\\\' in %s" %\n+                          (s, self.filename))\n+        else:\n+            message = ("syntax error, unexpected \\\'%s\\\' (%s) in %s" %\n+                          (s, token.name, self.filename))\n+        raise ParseError(message, token.getsourcepos())\n \n \n     parser = pg.build()\ndiff --git a/test_phpt/conftest.py b/test_phpt/conftest.py\nindex c573daa8..8fe4d071 100644\n--- a/test_phpt/conftest.py\n+++ b/test_phpt/conftest.py\n@@ -38,6 +38,8 @@ check_sign_only = "check_sign_only"\n WIDTH = os.environ.get("COLUMNS", 300)\n COL_WIDTH = int(WIDTH) / 2 - 5\n \n+IS_TRAVIS = os.getenv(\'TRAVIS\') == \'true\'\n+\n \n def parse_phpt(fname):\n     skipif_src = []\n@@ -50,8 +52,9 @@ def parse_phpt(fname):\n     st = None\n     IGNORED = 999\n     state = {\'TEST\': -1, \'FILE\': 0, \'FILEEOF\': 0, \'EXPECT\': 1, \'EXPECTF\': 1,\n-             \'SKIPIF\': 5, \'INI\': 2, \'CLEAN\': 3, \'CREDITS\': IGNORED, \'GET\': 6,\n-             \'POST\': 7, \'COOKIE\': 8, \'XFAIL\': 9, \'DESCRIPTION\': IGNORED}\n+             \'SKIPIF\': 5, \'INI\': 2, \'CLEAN\': 3, \'CREDITS\': IGNORED,\n+             \'CREDIT\': IGNORED, \'GET\': 6, \'POST\': 7, \'COOKIE\': 8,\n+             \'XFAIL\': 9, \'DESCRIPTION\': IGNORED}\n     with open(fname) as f:\n         lines = f.readlines()\n     for l in lines:\n@@ -207,6 +210,7 @@ def matches_line(php, hippy, check_sign_only=False):\n     php = php.replace("%u|b%", "")\n     rphp = re.escape(php)\n     rphp = rphp.replace(\'\\%e\', \'.*\')\n+    rphp = rphp.replace(\'\\%x\', \'[0-9a-fA-F]+\')\n     rphp = rphp.replace(\'\\%s\', \'.*\')\n     rphp = rphp.replace(\'\\%a\', \'.*\')\n     rphp = rphp.replace(\'\\%f\', \'.*\')\n@@ -245,6 +249,7 @@ pcre_test_dir = \'ext/pcre\'\n hash_test_dir = \'ext/hash\'\n spl_test_dir = \'ext/spl\'\n Zend_test_dir = \'Zend\'\n+mcrypt_test_dir = \'ext/mcrypt\'\n \n os.environ["MYSQL_TEST_HOST"] = "localhost"\n os.environ["MYSQL_TEST_USER"] = "root"\n@@ -265,7 +270,7 @@ markers[array_test_dir] = {\n     \'bug25708.phpt\': "missing debug_zval_dump",\n     \'bug26458.phpt\': "missing debug_zval_dump",\n     \'bug35821.phpt\': "not implemented error",\n-    \'bug36975.phpt\': "missing natcasesort",\n+    \'bug36975.phpt\': "PHP quirk behavior",\n     \'bug45312.phpt\': "not implemented error",\n     \'bug61730.phpt\': "unexpected \'T_USE\'",\n \n@@ -278,17 +283,13 @@ markers[array_test_dir] = {\n     \'array_fill_object_2_4.phpt\': "order of class members",\n     \'array_filter_variation7.phpt\': "missing create_function()",\n \n-    \'array_intersect_1.phpt\': "class elems repr",\n     \'array_intersect_assoc_variation9.phpt\': \'too many notices\',\n     \'array_intersect_variation4.phpt\': "doesnt work properly",\n     \'array_intersect_variation8.phpt\': "wrong order of elems",\n     \'array_intersect_variation9.phpt\': "doesnt work properly",\n-    \'array_key_exists_object1.phpt\': ("array_key_exists() expects"\n-                                      "parameter 2 to be array"\n-                                      " object given"),\n-    \'array_key_exists_object2.phpt\': ("array_key_exists() expects "\n-                                      "parameter 2 to be array,"\n-                                      " object given"),\n+    \'array_key_exists_object1.phpt\': ("var_dump format is different and one key"\n+                                      "is reported as missing"),\n+    \'array_key_exists_object2.phpt\': "var_dump format is different",\n     \'array_keys_variation_002.phpt\': "doesnt work prop",\n     \'array_keys_variation_003.phpt\': "doesnt work prop",\n     \'array_keys_variation_004.phpt\': "doesnt work prop",\n@@ -303,9 +304,6 @@ markers[array_test_dir] = {\n     \'array_pad_variation2.phpt\': "arg parse problem",\n     \'array_product_variation1.phpt\': "instance unimplemented as_number",\n     \'array_product_variation4.phpt\': "?",\n-    \'array_push_variation4.phpt\': "?",\n-    \'array_push.phpt\': "at least problem",\n-    \'array_push_error1.phpt\': "at least problem",\n     \'array_push_error2.phpt\': "XXX push item in array having key = sys.maxint should fail",\n     \'array_replace.phpt\': "?",\n     \'array_search1.phpt\': "?",\n@@ -326,7 +324,6 @@ markers[array_test_dir] = {\n     \'array_uintersect_variation3.phpt\': "?",\n     \'array_unique_variation2.phpt\': "?",\n     \'array_unique_variation8.phpt\': "too many warnings?",\n-    \'array_unshift_error.phpt\': "at least problem",\n     \'array_walk_object1.phpt\': "?",\n     \'array_walk_objects.phpt\': "?",\n     \'array_walk_variation7.phpt\': "?",\n@@ -372,12 +369,12 @@ markers[array_test_dir] = {\n     \'ksort_variation2.phpt\': "wrong order of elems",\n     \'ksort_variation8.phpt\': "wrong odred of elems",\n     \'ksort_variation9.phpt\': "wrong order of elems",\n+    \'locale_sort.phpt\': \'Xfail: requires the locale fr_FR.ISO-8859-1 to be available\',\n     \'prev_error3.phpt\': "FatalError: Argument 1 for prev() must be a variable",\n     \'range_variation.phpt\': "parser problem",\n     \'rsort_basic.phpt\': "wrong order of elems",\n     \'rsort_variation2.phpt\': "wrong order of elems",\n     \'rsort_variation11.phpt\': "wrong order of elems",\n-    \'shuffle_error.phpt\': "?",\n     \'sort_variation2.phpt\': "wrong order of elems",\n     \'sort_variation11.phpt\': "?",\n     \'sort_variation9.phpt\': "?",\n@@ -388,8 +385,6 @@ markers[array_test_dir] = {\n     \'uasort_variation6.phpt\': "?",\n     \'usort_variation6.phpt\': "?",\n     \'uksort_variation1.phpt\': "arg check order problem",\n-\n-    \'bug25758.phpt\': "?",\n     \'range_variation1.phpt\': "in/float mix",\n     \'rsort_variation3.phpt\': "in/float mix",\n     \'usort_variation7.phpt\': "missing create_function()",\n@@ -399,12 +394,6 @@ markers[array_test_dir] = {\n \n markers[class_object_test_dir] = {\n     \'get_class_error_001.phpt\': "bad return value on failures",\n-    \'get_class_methods_basic_001.phpt\': "undefined get_class_methods()",\n-    \'get_class_methods_basic_002.phpt\': "undefined get_class_methods()",\n-    \'get_class_methods_basic_003.phpt\': "undefined get_class_methods()",\n-    \'get_class_methods_error_001.phpt\': "undefined get_class_methods()",\n-    \'get_class_methods_variation_001.phpt\': "undefined get_class_methods()",\n-    \'get_class_methods_variation_002.phpt\': "undefined get_class_methods()",\n     \'get_class_vars_variation2.phpt\': "undefined get_class_vars()",\n     \'get_declared_classes_basic_001.phpt\': "works,  problem with %s regexp in output",\n     \'get_declared_interfaces_basic_001.phpt\': "works,  problem with %s regexp in output",\n@@ -427,6 +416,7 @@ markers[class_object_test_dir] = {\n markers[math_test_dir] = {\n     "bug28228.phpt": "bullshit NULL as string arg",\n     \'bug45712.phpt\': "the test is wrong (asks for inf != inf)",\n+    \'tan_basiclong_64bit.phpt\': \'Xfail: It produces a different result on Travis\',\n }\n \n \n@@ -441,6 +431,8 @@ markers[dir_test_dir] = {\n \n # FILE\n markers[file_test_dir] = {\n+    \'bug26615.phpt\': \'SKIP: requires TEST_PHP_EXECUTABLE in env\',\n+    \'bug26938.phpt\': \'SKIP: requires TEST_PHP_EXECUTABLE in env\',\n     \'001.phpt\': "?",\n     \'004.phpt\': "missing mkd5_file()",\n     \'bug12556.phpt\': "?",\n@@ -451,9 +443,7 @@ markers[file_test_dir] = {\n     \'bug45303.phpt\': "nightmare...",\n     \'bug45303.phpt\': "nightmare...",\n     \'bug52624.phpt\': "nightmare...",\n-    \'bug22414.phpt\': "missing passthru()",\n-    \'bug26615.phpt\': "missing exec()",\n-    \'bug26938.phpt\': "missing exec()",\n+    \'bug22414.phpt\': "missing md5_file()",\n     \'bug27508.phpt\': "missing stream_wrapper_register()",\n     \'bug27619.phpt\': "?",\n     \'bug30362.phpt\': "missing stream_get_line()",\n@@ -473,20 +463,18 @@ markers[file_test_dir] = {\n     \'bug46347.phpt\': "missing parse_ini_file()",\n     \'bug40501.phpt\': "?",\n     \'bug41655_1.phpt\': "glob problem",\n-    \'bug41655_2.phpt\': "glob problem",\n     \'bug44034.phpt\': "?",\n     \'bug51094.phpt\': "missing parse_ini_string()",\n     \'bug53241.phpt\': "missing curl_init()",\n     \'bug53848.phpt\': "?",\n     \'bug63512.phpt\': "missing parse_ini_string()",\n     \'directory_wrapper_fstat_basic.phpt\': "?",\n-    \'clearstatcache_001.phpt\': "missing passthru()",\n+    \'clearstatcache_001.phpt\': "?",\n     \'copy_variation4.phpt\': "imo whole expect is wrong",\n     \'copy_variation3.phpt\': "imo whole expect is wrong",\n     \'fgetc_variation1.phpt\': "compile None",\n \n     \'php_fd_wrapper_03.phpt\': "HW: creating array_from empty...",\n-    # \'popen_pclose_error.phpt\': \'popen not rpython\',\n \n     \'fopen_variation14.phpt\': "remote  host file access..?",\n     \'fopen_variation15.phpt\': "remote  host file access..?",\n@@ -524,7 +512,6 @@ markers[file_test_dir] = {\n     \'fgetcsv_variation29.phpt\': "not implemented",\n     \'fgetcsv_variation30.phpt\': "not implemented",\n     \'fgetcsv_variation31.phpt\': "not implemented",\n-    # \'fgets_socket_variation1.phpt\': "missing stream_socket_server()",\n     \'fgets_socket_variation2.phpt\': "error binding",\n     \'fgetss.phpt\': "not implemented",\n     \'fgetss1.phpt\': "not implemented",\n@@ -699,39 +686,37 @@ markers[file_test_dir] = {\n     \'fgetss_variation3.phpt\': slow,\n }\n \n+if IS_TRAVIS:\n+    markers[file_test_dir].update({\n+        \'get_current_user.phpt\': \'Fails with OSError: [Errno 25] Inappropriate ioctl for device on Travis\',\n+        \'fwrite_variation3.phpt\': \'On Travis ftell returns incorrectly after writing\',\n+        \'disk_free_space_basic.phpt\': \'Xfail: sometimes fail on Travis\',\n+    })\n+\n # POSIX\n markers[posix_test_dir] = {\n-    \'posix_access.phpt\': "?",\n-    \'posix_access_error_modes.phpt\': "?",\n-    \'posix_access_safemode.phpt\': "?",\n-    \'posix_kill_basic.phpt\': "missing shell_exec()",\n-    \'posix_ttyname.phpt\': "?",\n-    \'posix_ttyname_variation6.phpt\': "?",\n-    \'posix_errno_variation2.phpt\': \'missing shell_exec()\',\n-    \'posix_getgrgid.phpt\': \'missing posix_getgrgid()\',\n-    \'posix_getgrgid_basic.phpt\': \'missing posix_getgrgid()\',\n-    \'posix_getgrgid_error.phpt\': \'missing posix_getgrgid()\',\n-    \'posix_getgrgid_macosx.phpt\': \'missing posix_getgrgid()\',\n-    \'posix_getgrgid_variation.phpt\': \'missing posix_getgrgid()\',\n-    \'posix_getgrgid_wrongparams.phpt\': \'missing posix_getgrgid()\',\n+    \'posix_access.phpt\': "Expecting: Deprecated: Directive safe_mode is ...",  # Update the tests to PHP 5.4\n+    \'posix_access_error_modes.phpt\': "Expecting: Deprecated: Directive safe_mode is ...",\n+    \'posix_access_safemode.phpt\': "Expecting: Deprecated: Directive safe_mode is ...",\n+    \'posix_ttyname.phpt\': "OSError: [Errno 25] Inappropriate ioctl for device",\n+    \'posix_ttyname_variation6.phpt\': "Missing:  Error: 8 - Object of class classWithToString could not be converted to int",\n+    \'posix_getgrgid_basic.phpt\': \'Problems with the %a format in the test. Output looks good\',\n+    \'posix_getgrgid_macosx.phpt\': \'Test should be skipped in platforms other than mac\',\n     \'posix_ttyname_error_wrongparams.phpt\': \'missing imagecreate()\',\n+    \'posix_mkfifo_safemode.phpt\': \'Xfail: On Travis and other setups it is possible to create a fifo in /tmp (probably there is only one user)\',\n }\n \n+\n # STRING\n markers[string_test_dir] = {\n-    \'004.phpt\': slow,\n+    \'004.phpt\': "Section EXPECTREGEX not handled",\n     \'bug40754.phpt\': check_sign_only,\n     \'bug54454.phpt\': check_sign_only,\n     \'chunk_split.phpt\': slow,  # hangs on 64-bit\n-    \'explode.phpt\': "problem with var_export()",\n     \'implode.phpt\': "$php_errormsg",\n     \'htmlentities22.phpt\': "named constant in default args",\n     \'setlocale_error.phpt\': ("not implemented: (deprecated) "\n                              "category names as strings"),\n-    \'setlocale_basic1.phpt\': ("?"),\n-    \'setlocale_basic2.phpt\': ("?"),\n-    \'setlocale_basic3.phpt\': ("?"),\n-    \'setlocale_variation1.phpt\': ("?"),\n     \'setlocale_variation4.phpt\': ("expects en_US as "\n                                   "default system locale"),\n     \'setlocale_variation5.phpt\': ("expects en_US as "\n@@ -748,21 +733,16 @@ markers[string_test_dir] = {\n     \'wordwrap_variation2.phpt\': ("unimplemented corner "\n                                  "case when width < 0"),\n \n-    # \'sprintf_variation23.phpt\': \'resource problem\',\n-    # \'sprintf_variation36.phpt\': \'resource problem\',\n     \'sprintf_variation52.phpt\': \'some problem\',\n \n     \'005.phpt\': "not implemented",\n     \'006.phpt\': "not implemented",\n     \'007.phpt\': "not implemented",\n-    # \'bug21338.phpt\': "not implemented",\n     \'bug21453.phpt\': "not implemented",\n     \'bug21730.phpt\': "not implemented",\n     \'bug21744.phpt\': "not implemented",\n     \'bug22008.phpt\': "not implemented",\n     \'bug23650.phpt\': "not implemented",\n-    # \'bug24208.phpt\': "not implemented",\n-    # \'bug25707.phpt\': "not implemented",\n     \'bug26817.phpt\': "not implemented",\n     \'bug26819.phpt\': "not implemented",\n     \'bug27295.phpt\': "not implemented",\n@@ -770,18 +750,13 @@ markers[string_test_dir] = {\n     \'bug29119.phpt\': "not implemented",\n     \'bug35817.phpt\': "not implemented",\n     \'bug36148.phpt\': "not implemented",\n-    \'bug36306.phpt\': "not implemented",\n-    \'bug37262.phpt\': "not implemented",\n+    \'bug37262.phpt\': "Call to undefined function create_function()",\n     \'bug38322.phpt\': "not implemented",\n     \'bug38770.phpt\': "not implemented",\n     \'bug40432.phpt\': "not implemented",\n-    # \'bug40637.phpt\': "not implemented",\n-    # \'bug40704.phpt\': "not implemented",\n     \'bug42107.phpt\': "not implemented",\n-    # \'bug43927.phpt\': "not implemented",\n     \'bug44242.phpt\': "not implemented",\n     \'bug44703.phpt\': "not implemented",\n-    # \'bug45485.phpt\': "not implemented",\n     \'bug46578.phpt\': "not implemented",\n     \'bug47322.phpt\': "not implemented",\n     \'bug47443.phpt\': "not implemented",\n@@ -798,17 +773,12 @@ markers[string_test_dir] = {\n     \'bug54721.phpt\': "not implemented",\n     \'bug55674.phpt\': "not implemented",\n     \'bug55871.phpt\': "not implemented",\n-    # \'bug61374.phpt\': "not implemented",\n-    \'bug61660.phpt\': "not implemented",\n     \'bug61764.phpt\': "not implemented",\n     \'bug62443.phpt\': "not implemented",\n-    \'bug62462.phpt\': "not implemented",\n-    \'bug64879.phpt\': "not implemented",\n     \'convert_cyr_string.phpt\': "not implemented",\n     \'convert_cyr_string_basic.phpt\': "not implemented",\n     \'convert_cyr_string_error.phpt\': "not implemented",\n     \'convert_cyr_string_variation1.phpt\': "not implemented",\n-    \'crc32.phpt\': "not implemented",\n     \'crypt.phpt\': "not implemented",\n     \'crypt_blowfish.phpt\': "not implemented",\n     \'crypt_blowfish_variation1.phpt\': "not implemented",\n@@ -842,7 +812,6 @@ markers[string_test_dir] = {\n     \'hebrevc_variation2.phpt\': "not implemented",\n     \'highlight_file.phpt\': "not implemented",\n     \'html_entity_decode1.phpt\': "not implemented",\n-    # \'html_entity_decode2.phpt\': "not implemented",\n     \'html_entity_decode3.phpt\': "not implemented",\n     \'html_entity_decode_cp866.phpt\': "not implemented",\n     \'html_entity_decode_html4.phpt\': "not implemented",\n@@ -886,7 +855,6 @@ markers[string_test_dir] = {\n     \'http_build_query_error.phpt\': "not implemented",\n     \'http_build_query_variation1.phpt\': "not implemented",\n     \'http_build_query_variation2.phpt\': "not implemented",\n-    \'levenshtein.phpt\': "not implemented",\n     \'md5_file.phpt\': "not implemented",\n     \'metaphone.phpt\': "not implemented",\n     \'money_format_basic1.phpt\': "not implemented",\n@@ -899,14 +867,7 @@ markers[string_test_dir] = {\n     \'parse_str_basic2.phpt\': "not implemented",\n     \'parse_str_basic3.phpt\': "not implemented",\n     \'parse_str_basic4.phpt\': "not implemented",\n-    # \'parse_str_error1.phpt\': "not implemented",\n     \'php_strip_whitespace.phpt\': "not implemented",\n-    \'quoted_printable_decode_basic.phpt\': "not implemented",\n-    \'quoted_printable_decode_error.phpt\': "not implemented",\n-    \'quoted_printable_decode_variation1.phpt\': "not implemented",\n-    \'quoted_printable_encode_001.phpt\': "not implemented",\n-    \'quoted_printable_encode_002.phpt\': "not implemented",\n-    \'setlocale_variation2.phpt\': "not implemented",\n     \'sha1.phpt\': \'sha1_file not implemented\',\n     \'sha1_file.phpt\': "not implemented",\n     \'show_source_basic.phpt\': "not implemented",\n@@ -914,9 +875,6 @@ markers[string_test_dir] = {\n     \'show_source_variation2.phpt\': "not implemented",\n     \'similar_text_basic.phpt\': "not implemented",\n     \'similar_text_error.phpt\': "not implemented",\n-    \'soundex.phpt\': "not implemented",\n-    \'soundex_basic.phpt\': "not implemented",\n-    \'soundex_error.phpt\': "not implemented",\n     \'sscanf_basic1.phpt\': "not implemented",\n     \'sscanf_basic2.phpt\': "not implemented",\n     \'sscanf_basic3.phpt\': "not implemented",\n@@ -928,62 +886,46 @@ markers[string_test_dir] = {\n     \'sscanf_variation1.phpt\': "not implemented",\n     \'sscanf_variation2.phpt\': "not implemented",\n     \'str_getcsv_001.phpt\': "not implemented",\n-    \'str_shuffle.phpt\': "not implemented",\n-    \'str_shuffle_basic.phpt\': "not implemented",\n-    \'str_shuffle_error.phpt\': "not implemented",\n-    \'str_shuffle_variation1.phpt\': "not implemented",\n     \'str_word_count.phpt\': "not implemented",\n     \'str_word_count1.phpt\': "not implemented",\n     \'strip_tags.phpt\': "not implemented",\n-    # \'strip_tags_basic1.phpt\': "not implemented",\n     \'strip_tags_basic2.phpt\': "not implemented",\n-    # \'strip_tags_error.phpt\': "not implemented",\n-    # \'strip_tags_variation1.phpt\': "not implemented",\n     \'strip_tags_variation10.phpt\': "not implemented",\n     \'strip_tags_variation11.phpt\': "not implemented",\n     \'strip_tags_variation2.phpt\': "not implemented",\n-    # \'strip_tags_variation3.phpt\': "not implemented",\n     \'strip_tags_variation4.phpt\': "not implemented",\n     \'strip_tags_variation5.phpt\': "not implemented",\n     \'strip_tags_variation6.phpt\': "not implemented",\n     \'strip_tags_variation7.phpt\': "not implemented",\n     \'strip_tags_variation8.phpt\': "not implemented",\n     \'strip_tags_variation9.phpt\': "not implemented",\n-    # \'trim.phpt\': "not implemented",\n     \'unpack.phpt\': "not implemented",\n     \'unpack_error.phpt\': "not implemented",\n     \'vfprintf_error4.phpt\': "warning issue",\n     \'vfprintf_variation1.phpt\': "context",\n     \'wordwrap.phpt\': "not implemented",\n \n-    \'bug63943.phpt\': "need to review",\n     \'http_build_query_variation3.phpt\': "need to review",\n-    \'join_error.phpt\': "need to review",\n+    \'join_error.phpt\': "Errors say implode() instead of join()",\n     \'join_variation2.phpt\': "need to review",\n-    \'str_repeat.phpt\': "need to review",\n     \'str_replace.phpt\': "need to review",\n     \'stripos_variation10.phpt\': "need to review",\n     \'stripos_variation11.phpt\': "need to review",\n-    \'stristr_error.phpt\': "need to review",\n-    \'stristr_variation2.phpt\': "need to review",\n-    \'strlen.phpt\': "need to review",\n+    \'stristr_variation2.phpt\': "For an object it expects: Notice: Object of class sample could not be converted to int",\n+    \'strlen.phpt\': "Expects: Warning: strlen() expects parameter 1 to be string, array given got Notice instead",\n     \'strlen_variation1.phpt\': "need to review",\n     \'strncasecmp_variation10.phpt\': "need to review",\n     \'strncasecmp_variation11.phpt\': "need to review",\n     \'strncasecmp_variation4.phpt\': "need to review",\n     \'strncmp_variation4.phpt\': "need to review",\n-    \'strpos.phpt\': "need to review",\n     \'strrchr_variation10.phpt\': "need to review",\n     \'strrchr_variation11.phpt\': "need to review",\n     \'strrpos_variation10.phpt\': "need to review",\n     \'strrpos_variation11.phpt\': "need to review",\n-    \'strstr.phpt\': "need to review",\n }\n \n # GENERAL\n markers[general_test_dir] = {\n-    \'bug42272.phpt\': ("Bug #42272 (var_export()"\n-                      " incorrectly escapes char(0))"),\n     \'bug47027.phpt\': "Missing ArrayObject class",\n     \'bug60227_4.phpt\': \'SKIP: Unknown phpt section header: EXPECTHEADERS\',\n     \'bug60227_3.phpt\': \'SKIP: Unknown phpt section header: EXPECTHEADERS\',\n@@ -993,10 +935,7 @@ markers[general_test_dir] = {\n                                      "abstract base class"),\n     \'debug_zval_dump_v.phpt\': ("NotImplementedError: "\n                                "abstract base class"),\n-    \'var_export_basic4.phpt\': "problem with strings",\n-    \'var_export_basic6.phpt\': ("missing static_scalar : T_ARRAY "\n-                               "( static_array_pair_list )"),\n-    \'var_export_basic9.phpt\': "?",\n+    \'var_export_basic6.phpt\': "var_dump reports different lengths",\n     \'type.phpt\': "?",\n     \'gettype_settype_basic.phpt\': "?",\n     \'parse_ini_file.phpt\': "parsing",\n@@ -1006,16 +945,12 @@ markers[general_test_dir] = {\n     \'call_user_func_array_variation_003.phpt\': "?",\n     \'call_user_func_array_variation_001.phpt\': "missing call_user_func_array()",\n \n-    \'002.phpt\': "not implemented",\n-    \'003.phpt\': "not implemented",\n     \'004.phpt\': "not implemented",\n-    \'006.phpt\': "not implemented",\n     \'010.phpt\': "not implemented",\n     \'bug27678.phpt\': "not implemented",\n     \'bug29038.phpt\': "not implemented",\n     \'bug32647.phpt\': "not implemented",\n     \'bug34794.phpt\': "not implemented",\n-    # \'bug35229.phpt\': "not implemented",\n     \'bug39322.phpt\': "not implemented",\n     \'bug40398.phpt\': "not implemented",\n     \'bug40752.phpt\': "not implemented",\n@@ -1037,8 +972,6 @@ markers[general_test_dir] = {\n     \'bug48768.phpt\': "not implemented",\n     \'bug49056.phpt\': "not implemented",\n     \'bug49692.phpt\': "not implemented",\n-    \'bug49847.phpt\': "not implemented",\n-    \'bug50732.phpt\': "not implemented",\n     \'bug52138.phpt\': "not implemented",\n     \'bug55371.phpt\': "not implemented",\n     \'bug60723.phpt\': "not implemented",\n@@ -1058,19 +991,17 @@ markers[general_test_dir] = {\n     \'get_extension_funcs_error.phpt\': "not implemented",\n     \'get_extension_funcs_variation.phpt\': "not implemented",\n     \'get_loaded_extensions_basic.phpt\': "not implemented",\n-    # \'get_magic_quotes_gpc.phpt\': "not implemented",\n     \'get_magic_quotes_runtime.phpt\': "not implemented",\n-    # \'getmypid_basic.phpt\': "not implemented",\n     \'getopt.phpt\': "not implemented",\n     \'getopt_002.phpt\': "not implemented",\n     \'getopt_003.phpt\': "not implemented",\n     \'getopt_004.phpt\': "not implemented",\n     \'getopt_005.phpt\': "not implemented",\n     \'gettype_settype_error.phpt\': "not implemented",\n-    \'get_cfg_var_basic.phpt\': "not implemented",\n-    \'get_cfg_var_variation6.phpt\': "not implemented",\n+    \'get_cfg_var_basic.phpt\': "requires ini parse to return strings",\n+    \'get_cfg_var_variation6.phpt\': "requires ini parse to return strings",\n     \'get_cfg_var_variation8.phpt\': "magic_quotes_gpc unsupported",\n-    \'get_cfg_var_variation9.phpt\': "error",\n+    \'get_cfg_var_variation9.phpt\': "requires ini parse to return strings",\n     \'head.phpt\': "not implemented",\n     \'highlight_heredoc.phpt\': "not implemented",\n     \'ini_get_all.phpt\': "not implemented",\n@@ -1090,10 +1021,6 @@ markers[general_test_dir] = {\n     \'proc_open02.phpt\': "not implemented",\n     \'set_magic_quotes_runtime_basic.phpt\': "not implemented",\n     \'set_magic_quotes_runtime_error.phpt\': "not implemented",\n-    # \'sleep_basic.phpt\': "not implemented",\n-    \'sleep_error.phpt\': "not implemented",\n-    \'usleep_basic.phpt\': "not implemented",\n-    \'usleep_error.phpt\': "not implemented",\n     \'var_dump_64bit.phpt\': "not implemented",\n }\n \n@@ -1148,7 +1075,6 @@ markers[classes_test_dir] = {\n     \'array_access_011.phpt\': "ArrayAccess: Operator implementation fix required",\n     \'array_access_012.phpt\': "ArrayAccess: Fix ++ to raise notice for indirect modification of overloaded element",\n     \'arrayobject_001.phpt\': "need review",\n-    \'autoload_002.phpt\': "missing get_class_methods()",\n     \'autoload_005.phpt\': "__destruct()",\n     \'autoload_010.phpt\': "__autoload() is called twice",\n     \'autoload_011.phpt\': "__autoload() is called twice",\n@@ -1223,8 +1149,6 @@ markers[lang_test_dir] = {\n     \'bug22510.phpt\': "unexpected T_LIST",\n     \'bug22690.phpt\': "missing create_function()",\n     \'bug23624.phpt\': "does not compile",\n-    # \'bug23922.phpt\': "$this when not in object context",\n-    # \'bug24396.phpt\': "does not parse",\n     \'bug24403.phpt\': "problem in preg_replace()",\n     \'bug24658.phpt\': "error wording",\n     \'bug24908.phpt\': "?",\n@@ -1321,7 +1245,6 @@ markers[security_test_dir] = {\n }\n \n markers[strings_test_dir] = {\n-    # \'001.phpt\': "missing strtok()",\n     \'002.phpt\': "problem with php://stdout",\n     \'004.phpt\': "undefined function highlight_string()",\n     \'bug26703.phpt\': "undefined function highlight_string()",\n@@ -1351,7 +1274,7 @@ markers[mysql_test_dir] = {\n     \'mysql_query_load_data_openbasedir.phpt\': "not finished",\n     \'mysql_result.phpt\': \'?\',\n     \'mysql_sql_safe_mode.phpt\': "?",\n-    \'mysql_stat.phpt\': "missing soundex()",\n+    # \'mysql_stat.phpt\': "missing soundex()",\n     \'mysql_trace_mode.phpt\': \'missing mysql_escape_string()\',\n }\n \n@@ -1406,7 +1329,6 @@ markers[session_test_dir] = {\n     \'bug36459.phpt\': \'not implemented\',\n     \'bug41600.phpt\': \'not implemented\',\n     \'bug42596.phpt\': \'not implemented\',\n-    # \'bug51338.phpt\': \'not implemented\',\n     \'bug53141.phpt\': \'not implemented\',\n     \'bug55688.phpt\': \'not implemented\',\n     \'bug60634_error_1.phpt\': \'not implemented\',\n@@ -1675,8 +1597,6 @@ markers[date_test_dir] = {\n     "gmdate_variation9.phpt": "not implemented",\n     "idate_variation5.phpt": "not implemented",\n     "idate_variation6.phpt": "not implemented",\n-    # "microtime_basic.phpt": "not implemented",\n-    # "microtime_error.phpt": "not implemented",\n     "oo_001.phpt": "not implemented",\n     "rfc-datetime_and_daylight_saving_time-type2.phpt": "not implemented",\n     "strtotime3-64bit.phpt": "not implemented",\n@@ -1701,7 +1621,6 @@ markers[pcre_test_dir] = {\n     \'004.phpt\': \'flag e unsupported\',\n     \'006.phpt\': \'backtrack_limit setting via --INI-- not working?\',\n     \'backtrack_limit.phpt\': \'in-progress\',\n-    # \'bug27103.phpt\': \'htmlentities unimplemented\',\n     \'bug44191.phpt\': \'preg_grep() unimplemented\',\n     \'bug44925.phpt\': \'preg_grep() unimplemented\',\n     \'bug52732.phpt\': \'SKIP: hangs\',\n@@ -1724,6 +1643,7 @@ markers[Zend_test_dir] = {\n     \'bug40236.phpt\': \'TEST_PHP_EXECUTABLE in env, should only run with -A\',\n     \'bug48408.phpt\': slow,\n     \'bug48409.phpt\': slow,\n+    \'bug60978.phpt\': \'SKIP: requires TEST_PHP_EXECUTABLE in env\',\n     \'closure_021.phpt\': slow,\n     \'exception_007.phpt\': slow,\n     \'001.phpt\': \'missing warnings around calling functions with wrong number \'\n@@ -1772,7 +1692,6 @@ markers[Zend_test_dir] = {\n     \'bug30922.phpt\': "missing fatal error",\n     \'bug30998.phpt\': "?",\n     \'bug32290.phpt\': "call_user_func_array()",\n-    \'bug32296.phpt\': "undefined get_class_methods()",\n     \'bug32322.phpt\': "?",\n     \'bug32596.phpt\': "?",\n     \'bug32660.phpt\': "?",\n@@ -1805,9 +1724,7 @@ markers[Zend_test_dir] = {\n     \'bug38624.phpt\': "stack trace",\n     \'bug38779.phpt\': "undefined stream_wrapper_register()",\n     \'bug38779_1.phpt\': "undefined stream_wrapper_register()",\n-    \'bug38942.phpt\': "undefined get_class_methods()",\n     \'bug39018.phpt\': "?",\n-    \'bug39542.phpt\': "Cannot redeclare __autoload()",\n     \'bug40509.phpt\': "?",\n     \'bug40621.phpt\': "strict vs fatal error",\n     \'bug40705.phpt\': "?",\n@@ -1840,7 +1757,6 @@ markers[Zend_test_dir] = {\n     \'bug43344_8.phpt\': "notice should be a fatal",\n     \'bug43344_9.phpt\': "notice should be a fatal",\n     \'bug43450.phpt\': slow,\n-    \'bug43483.phpt\': "undefined get_class_methods()",\n     \'bug43703.phpt\': "?",\n     \'bug43918.phpt\': "missing SimpleXMLElement",\n     \'bug44141.phpt\': "Call to private X::__construct()",\n@@ -1883,7 +1799,7 @@ markers[Zend_test_dir] = {\n     \'bug50174.phpt\': "missing ReflectionMethod",\n     \'bug50261.phpt\': "?",\n     \'bug50383.phpt\': "$exc->getTrace()",\n-    \'bug50810.phpt\': "missing method_exists()",\n+    \'bug50810.phpt\': "Fails in a method calling property_exists()",\n     \'bug51394.phpt\': "stack trace",\n     \'bug51421.phpt\': "signature check for ctor",\n     \'bug51822.phpt\': "?",\n@@ -1935,7 +1851,6 @@ markers[Zend_test_dir] = {\n     \'bug60825.phpt\': "?",\n     \'bug60909_1.phpt\': "missing register_shutdown_function()",\n     \'bug60909_2.phpt\': "missing register_shutdown_function()",\n-    \'bug60978.phpt\': "missing exec()",\n     \'bug61087.phpt\': "missing parse_ini_file()",\n     \'bug61225.phpt\': "unexpected T_STRING",\n     \'bug61273.phpt\': "call_user_func_array()",\n@@ -2065,6 +1980,7 @@ markers[Zend_test_dir] = {\n     \'exception_handler_004.phpt\': "?",\n     \'exception_handler_006.phpt\': "?",\n     \'fr47160.phpt\': "?",\n+    \'function_arguments_002.phpt\': \'PHP syntax error say what token it was expecting\',\n     \'gc_001.phpt\': "?",\n     \'gc_002.phpt\': "?",\n     \'gc_003.phpt\': "?",\n@@ -2096,9 +2012,7 @@ markers[Zend_test_dir] = {\n     \'gc_030.phpt\': "?",\n     \'gc_031.phpt\': "?",\n     \'gc_032.phpt\': "?",\n-    \'get_class_methods_001.phpt\': "?",\n-    \'get_class_methods_002.phpt\': "?",\n-    \'get_class_methods_003.phpt\': "?",\n+    \'get_class_methods_002.phpt\': "Missing: Strict Standards: Redefining already defined constructor for class B in %s on line %d",\n     \'get_class_vars_001.phpt\': "?",\n     \'get_class_vars_002.phpt\': "?",\n     \'get_class_vars_003.phpt\': "?",\n@@ -2429,8 +2343,8 @@ markers[\'ext/reflection\'] = {\n     \'bug48757.phpt\': \'?\',\n     \'bug49074.phpt\': \'?\',\n     \'bug49719.phpt\': \'?\',\n-    \'bug51905.phpt\': \'?\',\n-    \'bug51911.phpt\': \'?\',\n+    \'bug51905.phpt\': \'Call to undefined method ReflectionParameter::isDefaultValueAvailable()\',\n+    \'bug51911.phpt\': \'Call to undefined method ReflectionParameter::isDefaultValueAvailable()\',\n     \'bug52057.phpt\': \'?\',\n     \'bug52854.phpt\': \'?\',\n     \'bug53366.phpt\': \'?\',\n@@ -2541,7 +2455,6 @@ markers[spl_test_dir] = {\n     \'bug38325.phpt\': "?",\n     \'bug38618.phpt\': "?",\n     \'bug40036.phpt\': "?",\n-    # \'bug40091.phpt\': "?",\n     \'bug40442.phpt\': "?",\n     \'bug40872.phpt\': "?",\n     \'bug41528.phpt\': "?",\n@@ -2550,7 +2463,6 @@ markers[spl_test_dir] = {\n     \'bug41828.phpt\': "Missing RecursiveIteratorIterator",\n     \'bug42654.phpt\': "?",\n     \'bug42703.phpt\': "?",\n-    # \'bug44144.phpt\': "?",\n     \'bug44615.phpt\': "?",\n     \'bug45216.phpt\': "Missing SplFileObject::fgetss",\n     \'bug45614.phpt\': "?",\n@@ -2562,7 +2474,6 @@ markers[spl_test_dir] = {\n     \'bug46115.phpt\': "?",\n     \'bug46160.phpt\': "?",\n     \'bug48361.phpt\': "?",\n-    # \'bug48493.phpt\': "?",\n     \'bug49263.phpt\': "?",\n     \'bug49723.phpt\': "?",\n     \'bug49972.phpt\': "?",\n@@ -2821,11 +2732,9 @@ markers[spl_test_dir] = {\n     \'spl_autoload_006.phpt\': "?",\n     \'spl_autoload_007.phpt\': "?",\n     \'spl_autoload_008.phpt\': "?",\n-    # \'spl_autoload_010.phpt\': "?",\n     \'spl_autoload_011.phpt\': "?",\n     \'spl_autoload_012.phpt\': "?",\n     \'spl_autoload_013.phpt\': "?",\n-    # \'spl_autoload_014.phpt\': "?",\n     \'spl_caching_iterator_constructor_flags.phpt\': "?",\n     \'spl_cachingiterator_setFlags_basic.phpt\': "?",\n     \'spl_cachingiterator___toString_basic.phpt\': "?",\n@@ -2876,7 +2785,6 @@ markers[spl_test_dir] = {\n     \'SplDoublyLinkedList_top_pass_null.phpt\': "?",\n     \'SplDoublyLinkedList_unshift_missing_parameter.phpt\': "?",\n     \'SplFileInfo_getGroup_error.phpt\': "No frames for builtin methods",\n-    \'SplFileInfo_getInode_basic.phpt\': "Missing shell_exec()",\n     \'SplFileInfo_getInode_error.phpt\': "No frames for builtin methods",\n     \'SplFileInfo_getOwner_error.phpt\': "No frames for builtin methods",\n     \'SplFileInfo_getPerms_error.phpt\': "No frames for builtin methods",\n@@ -3039,7 +2947,18 @@ markers[hash_test_dir] = {\n     \'whirlpool.phpt\':  slow,\n }\n \n-prerequisites = {hash_test_dir: "hash", mysql_test_dir: "mysql"}\n+markers[mcrypt_test_dir] = {\n+    \'mcrypt_decrypt_variation4.phpt\': \'missing obj to str cast one warn level 8\',\n+    \'mcrypt_ecb_variation4.phpt\': \'missing obj to str cast one warn level 8\',\n+    \'mcrypt_encrypt_variation4.phpt\': \'missing obj to str cast one warn level 8\',\n+    \'mcrypt_filters.phpt\': \'missing stream filters\',\n+    \'mcrypt_get_cipher_name.phpt\': \'missing\',\n+}\n+\n+prerequisites = {hash_test_dir: "hash",\n+                 mysql_test_dir: "mysql",\n+                 mcrypt_test_dir: "mcrypt"}\n+\n \n class PHPTest(Item):\n     def runtest(self):\n@@ -3160,7 +3079,7 @@ def phpt_test(dir, file_name):\n         else:\n             py.test.skip(marker)     # failed as expected\n     else:\n-        if marker is None:\n+        if marker is None or marker.lower().startswith(\'xfail:\'):\n             pass       # everything is passing\n         else:\n             raise Exception("the test \'%s\' was supposed to fail, but didn\'t"\ndiff --git a/test_phpt/ext/mcrypt/blowfish.phpt b/test_phpt/ext/mcrypt/blowfish.phpt\nnew file mode 100644\nindex 00000000..a133091d\n--- /dev/null\n+++ b/test_phpt/ext/mcrypt/blowfish.phpt\n@@ -0,0 +1,91 @@\n+--TEST--\n+Test for blowfish compatibility\n+--SKIPIF--\n+<?php if (!extension_loaded("mcrypt")) print "skip"; ?>\n+--FILE--\n+<?php\n+if(!function_exists("hex2bin")) {\n+    function hex2bin($data) {\n+       $len = strlen($data);\n+       return pack("H" . $len, $data);\n+    }   \n+}\n+\n+print "key               plain             crypt             guess             stat\\n";\n+$null = "\\0\\0\\0\\0\\0\\0\\0\\0";\n+$vectors = file(dirname(__FILE__) . "/vectors.txt");\n+\n+$td = mcrypt_module_open ("blowfish", "", MCRYPT_MODE_ECB, "");\n+\n+foreach($vectors as $data) {\n+    $data = trim($data);\n+    if ($data) {\n+        list($key,$plain,$crypt) = preg_split("/[[:space:]]+/",$data);\n+        printf("%s  %s  ",\n+            $key,\n+            $plain\n+        );  \n+        $key = hex2bin(trim($key));\n+        $plain = hex2bin(($plain));\n+        $crypt = strtolower(trim($crypt));\n+\n+        mcrypt_generic_init ($td, $key, $null);\n+        $guess = mcrypt_generic ($td, $plain);\n+        $guess = bin2hex($guess);\n+        printf("%s  %s  %s\\n",\n+            $crypt,\n+            $guess,\n+            ($crypt==$guess ? "OK" : "BAD")\n+        );  \n+    }   \n+}\n+\n+// Longer test case from http://www.schneier.com/code/vectors.txt\n+$td = mcrypt_module_open ("blowfish", "", MCRYPT_MODE_CBC, "");\n+\n+$key = hex2bin( "0123456789ABCDEFF0E1D2C3B4A59687" );\n+$iv = hex2bin( "FEDCBA9876543210" );\n+$plain = hex2bin( "37363534333231204E6F77206973207468652074696D6520666F722000" );\n+\n+mcrypt_generic_init( $td, $key, $iv );\n+$guess = bin2hex( mcrypt_generic( $td, $plain ) );\n+\n+echo "\\n", $guess, "\\n";\n+?>\n+--EXPECTF--\n+key               plain             crypt             guess             stat\n+0000000000000000  0000000000000000  4ef997456198dd78  4ef997456198dd78  OK\n+FFFFFFFFFFFFFFFF  FFFFFFFFFFFFFFFF  51866fd5b85ecb8a  51866fd5b85ecb8a  OK\n+3000000000000000  1000000000000001  7d856f9a613063f2  7d856f9a613063f2  OK\n+1111111111111111  1111111111111111  2466dd878b963c9d  2466dd878b963c9d  OK\n+0123456789ABCDEF  1111111111111111  61f9c3802281b096  61f9c3802281b096  OK\n+1111111111111111  0123456789ABCDEF  7d0cc630afda1ec7  7d0cc630afda1ec7  OK\n+FEDCBA9876543210  0123456789ABCDEF  0aceab0fc6a0a28d  0aceab0fc6a0a28d  OK\n+7CA110454A1A6E57  01A1D6D039776742  59c68245eb05282b  59c68245eb05282b  OK\n+0131D9619DC1376E  5CD54CA83DEF57DA  b1b8cc0b250f09a0  b1b8cc0b250f09a0  OK\n+07A1133E4A0B2686  0248D43806F67172  1730e5778bea1da4  1730e5778bea1da4  OK\n+3849674C2602319E  51454B582DDF440A  a25e7856cf2651eb  a25e7856cf2651eb  OK\n+04B915BA43FEB5B6  42FD443059577FA2  353882b109ce8f1a  353882b109ce8f1a  OK\n+0113B970FD34F2CE  059B5E0851CF143A  48f4d0884c379918  48f4d0884c379918  OK\n+0170F175468FB5E6  0756D8E0774761D2  432193b78951fc98  432193b78951fc98  OK\n+43297FAD38E373FE  762514B829BF486A  13f04154d69d1ae5  13f04154d69d1ae5  OK\n+07A7137045DA2A16  3BDD119049372802  2eedda93ffd39c79  2eedda93ffd39c79  OK\n+04689104C2FD3B2F  26955F6835AF609A  d887e0393c2da6e3  d887e0393c2da6e3  OK\n+37D06BB516CB7546  164D5E404F275232  5f99d04f5b163969  5f99d04f5b163969  OK\n+1F08260D1AC2465E  6B056E18759F5CCA  4a057a3b24d3977b  4a057a3b24d3977b  OK\n+584023641ABA6176  004BD6EF09176062  452031c1e4fada8e  452031c1e4fada8e  OK\n+025816164629B007  480D39006EE762F2  7555ae39f59b87bd  7555ae39f59b87bd  OK\n+49793EBC79B3258F  437540C8698F3CFA  53c55f9cb49fc019  53c55f9cb49fc019  OK\n+4FB05E1515AB73A7  072D43A077075292  7a8e7bfa937e89a3  7a8e7bfa937e89a3  OK\n+49E95D6D4CA229BF  02FE55778117F12A  cf9c5d7a4986adb5  cf9c5d7a4986adb5  OK\n+018310DC409B26D6  1D9D5C5018F728C2  d1abb290658bc778  d1abb290658bc778  OK\n+1C587F1C13924FEF  305532286D6F295A  55cb3774d13ef201  55cb3774d13ef201  OK\n+0101010101010101  0123456789ABCDEF  fa34ec4847b268b2  fa34ec4847b268b2  OK\n+1F1F1F1F0E0E0E0E  0123456789ABCDEF  a790795108ea3cae  a790795108ea3cae  OK\n+E0FEE0FEF1FEF1FE  0123456789ABCDEF  c39e072d9fac631d  c39e072d9fac631d  OK\n+0000000000000000  FFFFFFFFFFFFFFFF  014933e0cdaff6e4  014933e0cdaff6e4  OK\n+FFFFFFFFFFFFFFFF  0000000000000000  f21e9a77b71c49bc  f21e9a77b71c49bc  OK\n+0123456789ABCDEF  0000000000000000  245946885754369a  245946885754369a  OK\n+FEDCBA9876543210  FFFFFFFFFFFFFFFF  6b5c5a9c5d9e0a5a  6b5c5a9c5d9e0a5a  OK\n+\n+6b77b4d63006dee605b156e27403979358deb9e7154616d959f1652bd5ff92cc\ndiff --git a/test_phpt/ext/mcrypt/bug35496.phpt b/test_phpt/ext/mcrypt/bug35496.phpt\nnew file mode 100644\nindex 00000000..3add65e0\n--- /dev/null\n+++ b/test_phpt/ext/mcrypt/bug35496.phpt\n@@ -0,0 +1,14 @@\n+--TEST--\n+Bug #35496 (Crash in mcrypt_generic()/mdecrypt_generic() without proper init).\n+--SKIPIF--\n+<?php if (!extension_loaded("mcrypt")) print "skip"; ?>\n+--FILE--\n+<?php\n+$td = mcrypt_module_open(\'rijndael-256\', \'\', \'ofb\', \'\');\n+mcrypt_generic($td, "foobar");\n+mdecrypt_generic($td, "baz");\n+?>\n+--EXPECTF--\n+Warning: mcrypt_generic(): Operation disallowed prior to mcrypt_generic_init(). in %sbug35496.php on line 3\n+\n+Warning: mdecrypt_generic(): Operation disallowed prior to mcrypt_generic_init(). in %sbug35496.php on line 4\ndiff --git a/test_phpt/ext/mcrypt/bug37595.phpt b/test_phpt/ext/mcrypt/bug37595.phpt\nnew file mode 100644\nindex 00000000..0530f3e8\nBinary files /dev/null and b/test_phpt/ext/mcrypt/bug37595.phpt differ\ndiff --git a/test_phpt/ext/mcrypt/bug41252.phpt b/test_phpt/ext/mcrypt/bug41252.phpt\nnew file mode 100644\nindex 00000000..481fc549\n--- /dev/null\n+++ b/test_phpt/ext/mcrypt/bug41252.phpt\n@@ -0,0 +1,13 @@\n+--TEST--\n+Bug #41252 (Calling mcrypt_generic without first calling mcrypt_generic_init crashes)\n+--SKIPIF--\n+<?php if (!extension_loaded("mcrypt")) print "skip"; ?>\n+--FILE--\n+<?php\n+$td = mcrypt_module_open(MCRYPT_DES, \'\', MCRYPT_MODE_ECB, \'\');\n+echo mcrypt_generic($td,\'aaaaaaaa\');\n+print "I\'m alive!\\n";\n+?>\n+--EXPECTF--\n+Warning: mcrypt_generic(): Operation disallowed prior to mcrypt_generic_init(). in %sbug41252.php on line 3\n+I\'m alive!\ndiff --git a/test_phpt/ext/mcrypt/bug43143.phpt b/test_phpt/ext/mcrypt/bug43143.phpt\nnew file mode 100644\nindex 00000000..d9fccf3c\n--- /dev/null\n+++ b/test_phpt/ext/mcrypt/bug43143.phpt\n@@ -0,0 +1,23 @@\n+--TEST--\n+Bug #43143 (Warning about empty IV with MCRYPT_MODE_ECB)\n+--SKIPIF--\n+<?php if (!extension_loaded("mcrypt")) print "skip"; \n+if (!extension_loaded("hash")) print "skip"; ?>\n+--FILE--\n+<?php\n+echo "ECB\\n";\n+$input = \'to be encrypted\';\n+$mkey = hash(\'sha256\', \'secret key\', TRUE);\n+$data = mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $mkey, $input, MCRYPT_MODE_ECB);\n+echo "CFB\\n";\n+$input = \'to be encrypted\';\n+$mkey = hash(\'sha256\', \'secret key\', TRUE);\n+$data = mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $mkey, $input, MCRYPT_MODE_CFB);\n+echo "END\\n";\n+?>\n+--EXPECTF--\n+ECB\n+CFB\n+\n+Warning: mcrypt_encrypt(): Attempt to use an empty IV, which is NOT recommend in %sbug43143.php on line 9\n+END\ndiff --git a/test_phpt/ext/mcrypt/bug46010.phpt b/test_phpt/ext/mcrypt/bug46010.phpt\nnew file mode 100644\nindex 00000000..ddb691e3\n--- /dev/null\n+++ b/test_phpt/ext/mcrypt/bug46010.phpt\n@@ -0,0 +1,16 @@\n+--TEST--\n+Bug #46010 (warnings incorrectly generated for iv in ecb mode)\n+--SKIPIF--\n+<?php if (!extension_loaded("mcrypt")) print "skip"; ?>\n+--FILE--\n+<?php\n+\n+var_dump(bin2hex(mcrypt_encrypt(MCRYPT_TRIPLEDES, "key", "data", MCRYPT_MODE_ECB)));\n+var_dump(bin2hex(mcrypt_encrypt(MCRYPT_TRIPLEDES, "key", "data", MCRYPT_MODE_ECB, "a")));\n+var_dump(bin2hex(mcrypt_encrypt(MCRYPT_TRIPLEDES, "key", "data", MCRYPT_MODE_ECB, "12345678")));\n+\n+?>\n+--EXPECTF--\n+string(16) "372eeb4a524b8d31"\n+string(16) "372eeb4a524b8d31"\n+string(16) "372eeb4a524b8d31"\ndiff --git a/test_phpt/ext/mcrypt/bug49738.phpt b/test_phpt/ext/mcrypt/bug49738.phpt\nnew file mode 100644\nindex 00000000..8f01bec4\n--- /dev/null\n+++ b/test_phpt/ext/mcrypt/bug49738.phpt\n@@ -0,0 +1,13 @@\n+--TEST--\n+Bug #49738 (calling mcrypt after mcrypt_generic_deinit crashes)\n+--SKIPIF--\n+<?php if (!extension_loaded("mcrypt")) print "skip"; ?>\n+--FILE--\n+<?php\n+   $td = mcrypt_module_open(MCRYPT_DES, \'\', MCRYPT_MODE_ECB, \'\');\n+   mcrypt_generic_init($td, \'aaaaaaaa\', \'aaaaaaaa\');\n+   mcrypt_generic_deinit($td);\n+   echo mcrypt_generic($td, \'aaaaaaaa\');\n+?>\n+--EXPECTF--\n+Warning: mcrypt_generic(): Operation disallowed prior to mcrypt_generic_init(). in %sbug49738.php on line 5\ndiff --git a/test_phpt/ext/mcrypt/bug55169.phpt b/test_phpt/ext/mcrypt/bug55169.phpt\nnew file mode 100644\nindex 00000000..bebcd675\n--- /dev/null\n+++ b/test_phpt/ext/mcrypt/bug55169.phpt\n@@ -0,0 +1,44 @@\n+--TEST--\r\n+mcrypt_create_iv https://bugs.php.net/bug.php?id=55169\r\n+--CREDIT--\r\n+Ryan Biesemeyer <ryan@yaauie.com>\r\n+--SKIPIF--\r\n+<?php if (!extension_loaded("mcrypt")) print "skip"; ?>\r\n+--FILE--\r\n+<?php\r\n+for( $i=1; $i<=64; $i = $i*2 ){\r\n+  echo \'Input: \'. $i . PHP_EOL;\r\n+  $random = mcrypt_create_iv( $i, MCRYPT_DEV_URANDOM );\r\n+  echo \' Length: \' . strlen( $random ) . PHP_EOL;\r\n+  echo \' Hex: \'. bin2hex( $random ) . PHP_EOL;\r\n+  echo PHP_EOL;\r\n+}\r\n+?>\r\n+--EXPECTF--\r\n+Input: 1\r\n+ Length: 1\r\n+ Hex: %x\r\n+\r\n+Input: 2\r\n+ Length: 2\r\n+ Hex: %x\r\n+\r\n+Input: 4\r\n+ Length: 4\r\n+ Hex: %x\r\n+\r\n+Input: 8\r\n+ Length: 8\r\n+ Hex: %x\r\n+\r\n+Input: 16\r\n+ Length: 16\r\n+ Hex: %x\r\n+\r\n+Input: 32\r\n+ Length: 32\r\n+ Hex: %x\r\n+\r\n+Input: 64\r\n+ Length: 64\r\n+ Hex: %x\r\ndiff --git a/test_phpt/ext/mcrypt/bug8040.phpt b/test_phpt/ext/mcrypt/bug8040.phpt\nnew file mode 100644\nindex 00000000..78fef5ca\n--- /dev/null\n+++ b/test_phpt/ext/mcrypt/bug8040.phpt\n@@ -0,0 +1,24 @@\n+--TEST--\n+Bug #8040 (MCRYPT_MODE_* do not seem to exist)\n+--SKIPIF--\n+<?php if (!extension_loaded("mcrypt")) print "skip"; ?>\n+--FILE--\n+<?php\n+\terror_reporting (E_ALL ^ E_NOTICE);\n+\techo MCRYPT_TWOFISH."\\n";\n+\techo MCRYPT_MODE_CBC."\\n";\n+\n+\tdefine ("MODE1", MCRYPT_MODE_CBC);\n+\techo MODE1."\\n";\n+\n+\tdefine ("CIPHER", MCRYPT_TWOFISH);\n+\tdefine ("MODE2", MCRYPT_MODE_CBC);\n+\tdefine ("MODE3", MCRYPT_CBC);\n+\n+\tprintf ("cipher=".CIPHER. " mode1=".MODE2. " mode2=". MODE3."\\n");\n+?>\n+--EXPECT--\n+twofish\n+cbc\n+cbc\n+cipher=twofish mode1=cbc mode2=MCRYPT_CBC\ndiff --git a/test_phpt/ext/mcrypt/mcrypt_cbc.phpt b/test_phpt/ext/mcrypt/mcrypt_cbc.phpt\nnew file mode 100644\nindex 00000000..f9160db0\n--- /dev/null\n+++ b/test_phpt/ext/mcrypt/mcrypt_cbc.phpt\n@@ -0,0 +1,23 @@\n+--TEST--\n+mcrypt_cbc\n+--SKIPIF--\n+<?php if (!extension_loaded("mcrypt")) print "skip"; ?>\n+--FILE--\n+<?php\n+$key      = "FooBar";\n+$secret   = "PHP Testfest 2008";\n+$cipher   = MCRYPT_RIJNDAEL_128;\n+\n+$iv       = mcrypt_create_iv(mcrypt_get_iv_size($cipher, MCRYPT_MODE_ECB), MCRYPT_RAND);\n+$enc_data = mcrypt_cbc($cipher, $key, $secret, MCRYPT_ENCRYPT, $iv);\n+\n+// we have to trim as AES rounds the blocks and decrypt doesnt detect that\n+echo trim(mcrypt_cbc($cipher, $key, $enc_data, MCRYPT_DECRYPT, $iv)) . "\\n";\n+\n+// a warning must be issued if we don\'t use a IV on a AES cipher, that usually requires an IV\n+mcrypt_cbc($cipher, $key, $enc_data, MCRYPT_DECRYPT);\n+\n+--EXPECTF--\n+PHP Testfest 2008\n+\n+Warning: mcrypt_cbc(): Attempt to use an empty IV, which is NOT recommend in %s on line %d\ndiff --git a/test_phpt/ext/mcrypt/mcrypt_cbc_3des_decrypt.phpt b/test_phpt/ext/mcrypt/mcrypt_cbc_3des_decrypt.phpt\nnew file mode 100644\nindex 00000000..6df30799\n--- /dev/null\n+++ b/test_phpt/ext/mcrypt/mcrypt_cbc_3des_decrypt.phpt\n@@ -0,0 +1,102 @@\n+--TEST--\n+Test mcrypt_cbc() function : basic functionality \n+--SKIPIF--\n+<?php \n+if (!extension_loaded("mcrypt")) {\n+\tprint "skip - mcrypt extension not loaded"; \n+}\t \n+?>\n+--FILE--\n+<?php\n+/* Prototype  : string mcrypt_cbc(int cipher, string key, string data, int mode, string iv)\n+ * Description: CBC crypt/decrypt data using key key with cipher cipher starting with iv \n+ * Source code: ext/mcrypt/mcrypt.c\n+ * Alias to functions: \n+ */\n+\n+echo "*** Testing mcrypt_cbc() : basic functionality ***\\n";\n+\n+\n+$cipher = MCRYPT_TRIPLEDES;\n+$data = b"This is the secret message which must be encrypted";\n+$mode = MCRYPT_DECRYPT;\n+\n+// tripledes uses keys upto 192 bits (24 bytes)\n+$keys = array(\n+   b\'12345678\', \n+   b\'12345678901234567890\', \n+   b\'123456789012345678901234\', \n+   b\'12345678901234567890123456\'\n+);\n+$data1 = array(\n+   \'IleMhoxiOthmHua4tFBHOw==\',\n+   \'EeF1s6C+w1IiHj1gdDn81g==\',\n+   \'EEuXpjZPueyYoG0LGQ199Q==\',\n+   \'EEuXpjZPueyYoG0LGQ199Q==\'\n+);\n+// tripledes is a block cipher of 64 bits (8 bytes)\n+$ivs = array(\n+   b\'1234\', \n+   b\'12345678\', \n+   b\'123456789\'\n+);\n+   // data represented in base64 (ascii)\n+$data2 = array(\n+   \'+G7nGcWIxij3TZjpI9lJdQ==\',\n+   \'3bJiFMeyScxOLQcE6mZtLg==\',\n+   \'+G7nGcWIxij3TZjpI9lJdQ==\'\n+);\n+\n+$iv = b\'12345678\';\n+echo "\\n--- testing different key lengths\\n";\n+for ($i = 0; $i < sizeof($keys); $i++) {\n+   echo "\\nkey length=".strlen($keys[$i])."\\n";\n+   special_var_dump(mcrypt_cbc($cipher, $keys[$i], base64_decode($data1[$i]), $mode, $iv));\n+}\n+\n+$key = b\'1234567890123456\';  \n+echo "\\n--- testing different iv lengths\\n";\n+for ($i = 0; $i < sizeof($ivs); $i++) {\n+   echo "\\niv length=".strlen($ivs[$i])."\\n";\n+   special_var_dump(mcrypt_cbc($cipher, $key, base64_decode($data2[$i]), $mode, $ivs[$i]));\n+}\n+\n+function special_var_dump($str) {\n+   var_dump(bin2hex($str));\n+}  \n+?>\n+===DONE===\n+--EXPECTF--\n+*** Testing mcrypt_cbc() : basic functionality ***\n+\n+--- testing different key lengths\n+\n+key length=8\n+string(32) "736563726574206d6573736167650000"\n+\n+key length=20\n+string(32) "736563726574206d6573736167650000"\n+\n+key length=24\n+string(32) "736563726574206d6573736167650000"\n+\n+key length=26\n+\n+Warning: mcrypt_cbc(): Size of key is too large for this algorithm in %s on line %d\n+string(32) "736563726574206d6573736167650000"\n+\n+--- testing different iv lengths\n+\n+iv length=4\n+\n+Warning: mcrypt_cbc(): The IV parameter must be as long as the blocksize in %s on line %d\n+string(32) "736563726574206d6573736167650000"\n+\n+iv length=8\n+string(32) "736563726574206d6573736167650000"\n+\n+iv length=9\n+\n+Warning: mcrypt_cbc(): The IV parameter must be as long as the blocksize in %s on line %d\n+string(32) "736563726574206d6573736167650000"\n+===DONE===\ndiff --git a/test_phpt/ext/mcrypt/mcrypt_cbc_3des_encrypt.phpt b/test_phpt/ext/mcrypt/mcrypt_cbc_3des_encrypt.phpt\nnew file mode 100644\nindex 00000000..35fabd9a\n--- /dev/null\n+++ b/test_phpt/ext/mcrypt/mcrypt_cbc_3des_encrypt.phpt\n@@ -0,0 +1,85 @@\n+--TEST--\n+Test mcrypt_cbc() function : basic functionality \n+--SKIPIF--\n+<?php \n+if (!extension_loaded("mcrypt")) {\n+\tprint "skip - mcrypt extension not loaded"; \n+}\t \n+?>\n+--FILE--\n+<?php\n+/* Prototype  : string mcrypt_cbc(int cipher, string key, string data, int mode, string iv)\n+ * Description: CBC crypt/decrypt data using key key with cipher cipher starting with iv \n+ * Source code: ext/mcrypt/mcrypt.c\n+ * Alias to functions: \n+ */\n+\n+echo "*** Testing mcrypt_cbc() : basic functionality ***\\n";\n+\n+\n+$cipher = MCRYPT_TRIPLEDES;\n+$data = b"This is the secret message which must be encrypted";\n+$mode = MCRYPT_ENCRYPT;\n+\n+// tripledes uses keys upto 192 bits (24 bytes)\n+$keys = array(\n+   b\'12345678\', \n+   b\'12345678901234567890\', \n+   b\'123456789012345678901234\', \n+   b\'12345678901234567890123456\');\n+// tripledes is a block cipher of 64 bits (8 bytes)\n+$ivs = array(\n+   b\'1234\', \n+   b\'12345678\', \n+   b\'123456789\');\n+\n+\n+$iv = b\'12345678\';\n+echo "\\n--- testing different key lengths\\n";\n+foreach ($keys as $key) {\n+   echo "\\nkey length=".strlen($key)."\\n";\n+   var_dump(bin2hex(mcrypt_cbc($cipher, $key, $data, $mode, $iv)));\n+}\n+\n+$key = b\'1234567890123456\';  \n+echo "\\n--- testing different iv lengths\\n";\n+foreach ($ivs as $iv) {\n+   echo "\\niv length=".strlen($iv)."\\n";\n+   var_dump(bin2hex(mcrypt_cbc($cipher, $key, $data, $mode, $iv)));\n+}\n+?>\n+===DONE===\n+--EXPECTF--\n+*** Testing mcrypt_cbc() : basic functionality ***\n+\n+--- testing different key lengths\n+\n+key length=8\n+string(112) "082b437d039d09418e20dc9de1dafa7ed6da5c6335b78950968441da1faf40c1f886e04da8ca177b80b376811e138c1bf51cb48dae2e7939"\n+\n+key length=20\n+string(112) "0627351e0f8a082bf7981ae2c700a43fd3d44b270ac67b00fded1c5796eea935be0fef2a23da0b3f5e243929e62ac957bf0bf463aa90fc4f"\n+\n+key length=24\n+string(112) "b85e21072239d60c63a80e7c9ae493cb741a1cd407e52f451c5f43a0d103f55a7b62617eb2e44213c2d44462d388bc0b8f119384b12c84ac"\n+\n+key length=26\n+\n+Warning: mcrypt_cbc(): Size of key is too large for this algorithm in %s on line %d\n+string(112) "b85e21072239d60c63a80e7c9ae493cb741a1cd407e52f451c5f43a0d103f55a7b62617eb2e44213c2d44462d388bc0b8f119384b12c84ac"\n+\n+--- testing different iv lengths\n+\n+iv length=4\n+\n+Warning: mcrypt_cbc(): The IV parameter must be as long as the blocksize in %s on line %d\n+string(112) "440a6f54601969b127aad3c217ce7583c7f7b29989693130645569301db0020b29a34a3dcd104b2d0e3ba19d6cbd8a33d352b9c27cc34ef1"\n+\n+iv length=8\n+string(112) "bac347506bf092c5557c4363c301745d78f047028e2953e84fd66b30aeb6005812dadbe8baa871b83278341599b0c448ddaaa52b5a378ce5"\n+\n+iv length=9\n+\n+Warning: mcrypt_cbc(): The IV parameter must be as long as the blocksize in %s on line %d\n+string(112) "440a6f54601969b127aad3c217ce7583c7f7b29989693130645569301db0020b29a34a3dcd104b2d0e3ba19d6cbd8a33d352b9c27cc34ef1"\n+===DONE===\ndiff --git a/test_phpt/ext/mcrypt/mcrypt_cbc_error.phpt b/test_phpt/ext/mcrypt/mcrypt_cbc_error.phpt\nnew file mode 100644\nindex 00000000..ec3912b0\n--- /dev/null\n+++ b/test_phpt/ext/mcrypt/mcrypt_cbc_error.phpt\n@@ -0,0 +1,52 @@\n+--TEST--\n+Test mcrypt_cbc() function : error conditions \n+--SKIPIF--\n+<?php \n+if (!extension_loaded("mcrypt")) {\n+\tprint "skip - mcrypt extension not loaded"; \n+}\t \n+?>\n+--FILE--\n+<?php\n+/* Prototype  : string mcrypt_cbc(int cipher, string key, string data, int mode, string iv)\n+ * Description: CBC crypt/decrypt data using key key with cipher cipher starting with iv \n+ * Source code: ext/mcrypt/mcrypt.c\n+ * Alias to functions: \n+ */\n+\n+echo "*** Testing mcrypt_cbc() : error conditions ***\\n";\n+\n+\n+//Test mcrypt_cbc with one more than the expected number of arguments\n+echo "\\n-- Testing mcrypt_cbc() function with more than expected no. of arguments --\\n";\n+$cipher = 10;\n+$key = \'string_val\';\n+$data = \'string_val\';\n+$mode = 10;\n+$iv = \'string_val\';\n+$extra_arg = 10;\n+var_dump( mcrypt_cbc($cipher, $key, $data, $mode, $iv, $extra_arg) );\n+\n+// Testing mcrypt_cbc with one less than the expected number of arguments\n+echo "\\n-- Testing mcrypt_cbc() function with less than expected no. of arguments --\\n";\n+$cipher = 10;\n+$key = \'string_val\';\n+$data = \'string_val\';\n+var_dump( mcrypt_cbc($cipher, $key, $data) );\n+\n+?>\n+===DONE===\n+--EXPECTF--\n+*** Testing mcrypt_cbc() : error conditions ***\n+\n+-- Testing mcrypt_cbc() function with more than expected no. of arguments --\n+\n+Warning: mcrypt_cbc() expects at most 5 parameters, 6 given in %s on line %d\n+NULL\n+\n+-- Testing mcrypt_cbc() function with less than expected no. of arguments --\n+\n+Warning: mcrypt_cbc() expects at least 4 parameters, 3 given in %s on line %d\n+NULL\n+===DONE===\n+\ndiff --git a/test_phpt/ext/mcrypt/mcrypt_cbc_variation1.phpt b/test_phpt/ext/mcrypt/mcrypt_cbc_variation1.phpt\nnew file mode 100644\nindex 00000000..5482de3e\n--- /dev/null\n+++ b/test_phpt/ext/mcrypt/mcrypt_cbc_variation1.phpt\n@@ -0,0 +1,230 @@\n+--TEST--\n+Test mcrypt_cbc() function : usage variation \n+--SKIPIF--\n+<?php \n+if (!extension_loaded("mcrypt")) {\n+\tprint "skip - mcrypt extension not loaded"; \n+}\t \n+?>\n+--FILE--\n+<?php\n+/* Prototype  : string mcrypt_cbc(string cipher, string key, string data, int mode, string iv)\n+ * Description: CBC crypt/decrypt data using key key with cipher cipher starting with iv \n+ * Source code: ext/mcrypt/mcrypt.c\n+ * Alias to functions: \n+ */\n+\n+echo "*** Testing mcrypt_cbc() : usage variation ***\\n";\n+\n+// Define error handler\n+function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {\n+\tif (error_reporting() != 0) {\n+\t\t// report non-silenced errors\n+\t\techo "Error: $err_no - $err_msg, $filename($linenum)\\n";\n+\t}\n+}\n+set_error_handler(\'test_error_handler\');\n+\n+// Initialise function arguments not being substituted (if any)\n+$key = b\'string_val\';\n+$data = b\'string_val\';\n+$mode = MCRYPT_ENCRYPT;\n+$iv = b\'string_val\';\n+\n+//get an unset variable\n+$unset_var = 10;\n+unset ($unset_var);\n+\n+// define some classes\n+class classWithToString\n+{\n+\tpublic function __toString() {\n+\t\treturn "Class A object";\n+\t}\n+}\n+\n+class classWithoutToString\n+{\n+}\n+\n+// heredoc string\n+$heredoc = <<<EOT\n+hello world\n+EOT;\n+\n+// get a resource variable\n+$fp = fopen(__FILE__, "r");\n+\n+// add arrays\n+$index_array = array (1, 2, 3);\n+$assoc_array = array (\'one\' => 1, \'two\' => 2);\n+\n+//array of values to iterate over\n+$inputs = array(\n+\n+      // int data\n+      \'int 0\' => 0,\n+      \'int 1\' => 1,\n+      \'int 12345\' => 12345,\n+      \'int -12345\' => -2345,\n+\n+      // float data\n+      \'float 10.5\' => 10.5,\n+      \'float -10.5\' => -10.5,\n+      \'float 12.3456789000e10\' => 12.3456789000e10,\n+      \'float -12.3456789000e10\' => -12.3456789000e10,\n+      \'float .5\' => .5,\n+\n+      // array data\n+      \'empty array\' => array(),\n+      \'int indexed array\' => $index_array,\n+      \'associative array\' => $assoc_array,\n+      \'nested arrays\' => array(\'foo\', $index_array, $assoc_array),\n+\n+      // null data\n+      \'uppercase NULL\' => NULL,\n+      \'lowercase null\' => null,\n+\n+      // boolean data\n+      \'lowercase true\' => true,\n+      \'lowercase false\' =>false,\n+      \'uppercase TRUE\' =>TRUE,\n+      \'uppercase FALSE\' =>FALSE,\n+\n+      // empty data\n+      \'empty string DQ\' => "",\n+      \'empty string SQ\' => \'\',\n+\n+      // object data\n+      \'instance of classWithToString\' => new classWithToString(),\n+      \'instance of classWithoutToString\' => new classWithoutToString(),\n+\n+      // undefined data\n+      \'undefined var\' => @$undefined_var,\n+\n+      // unset data\n+      \'unset var\' => @$unset_var,\n+      \n+      // resource variable\n+      \'resource\' => $fp      \n+);\n+\n+// loop through each element of the array for cipher\n+\n+foreach($inputs as $valueType =>$value) {\n+      echo "\\n--$valueType--\\n";\n+      var_dump( mcrypt_cbc($value, $key, $data, $mode, $iv) );\n+};\n+\n+fclose($fp);\n+\n+?>\n+===DONE===\n+--EXPECTF--\n+*** Testing mcrypt_cbc() : usage variation ***\n+\n+--int 0--\n+Error: 2 - mcrypt_cbc(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--int 1--\n+Error: 2 - mcrypt_cbc(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--int 12345--\n+Error: 2 - mcrypt_cbc(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--int -12345--\n+Error: 2 - mcrypt_cbc(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--float 10.5--\n+Error: 2 - mcrypt_cbc(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--float -10.5--\n+Error: 2 - mcrypt_cbc(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--float 12.3456789000e10--\n+Error: 2 - mcrypt_cbc(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--float -12.3456789000e10--\n+Error: 2 - mcrypt_cbc(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--float .5--\n+Error: 2 - mcrypt_cbc(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--empty array--\n+Error: 2 - mcrypt_cbc() expects parameter 1 to be string, array given, %s(%d)\n+NULL\n+\n+--int indexed array--\n+Error: 2 - mcrypt_cbc() expects parameter 1 to be string, array given, %s(%d)\n+NULL\n+\n+--associative array--\n+Error: 2 - mcrypt_cbc() expects parameter 1 to be string, array given, %s(%d)\n+NULL\n+\n+--nested arrays--\n+Error: 2 - mcrypt_cbc() expects parameter 1 to be string, array given, %s(%d)\n+NULL\n+\n+--uppercase NULL--\n+Error: 2 - mcrypt_cbc(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--lowercase null--\n+Error: 2 - mcrypt_cbc(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--lowercase true--\n+Error: 2 - mcrypt_cbc(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--lowercase false--\n+Error: 2 - mcrypt_cbc(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--uppercase TRUE--\n+Error: 2 - mcrypt_cbc(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--uppercase FALSE--\n+Error: 2 - mcrypt_cbc(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--empty string DQ--\n+Error: 2 - mcrypt_cbc(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--empty string SQ--\n+Error: 2 - mcrypt_cbc(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--instance of classWithToString--\n+Error: 2 - mcrypt_cbc(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--instance of classWithoutToString--\n+Error: 2 - mcrypt_cbc() expects parameter 1 to be string, object given, %s(%d)\n+NULL\n+\n+--undefined var--\n+Error: 2 - mcrypt_cbc(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--unset var--\n+Error: 2 - mcrypt_cbc(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--resource--\n+Error: 2 - mcrypt_cbc() expects parameter 1 to be string, resource given, %s(%d)\n+NULL\n+===DONE===\n+\ndiff --git a/test_phpt/ext/mcrypt/mcrypt_cbc_variation2.phpt b/test_phpt/ext/mcrypt/mcrypt_cbc_variation2.phpt\nnew file mode 100644\nindex 00000000..f49e80ee\n--- /dev/null\n+++ b/test_phpt/ext/mcrypt/mcrypt_cbc_variation2.phpt\n@@ -0,0 +1,210 @@\n+--TEST--\n+Test mcrypt_cbc() function : usage variation \n+--SKIPIF--\n+<?php \n+if (!extension_loaded("mcrypt")) {\n+\tprint "skip - mcrypt extension not loaded"; \n+}\t \n+?>\n+--FILE--\n+<?php\n+/* Prototype  : string mcrypt_cbc(string cipher, string key, string data, int mode, string iv)\n+ * Description: CBC crypt/decrypt data using key key with cipher cipher starting with iv \n+ * Source code: ext/mcrypt/mcrypt.c\n+ * Alias to functions: \n+ */\n+\n+echo "*** Testing mcrypt_cbc() : usage variation ***\\n";\n+\n+// Define error handler\n+function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {\n+\tif (error_reporting() != 0) {\n+\t\t// report non-silenced errors\n+\t\techo "Error: $err_no - $err_msg, $filename($linenum)\\n";\n+\t}\n+}\n+set_error_handler(\'test_error_handler\');\n+\n+// Initialise function arguments not being substituted (if any)\n+$cipher = MCRYPT_TRIPLEDES;\n+$data = b\'string_val\';\n+$mode = MCRYPT_ENCRYPT;\n+$iv = b\'01234567\';\n+\n+//get an unset variable\n+$unset_var = 10;\n+unset ($unset_var);\n+\n+// define some classes\n+class classWithToString\n+{\n+\tpublic function __toString() {\n+\t\treturn b"Class A object";\n+\t}\n+}\n+\n+class classWithoutToString\n+{\n+}\n+\n+// heredoc string\n+$heredoc = b<<<EOT\n+hello world\n+EOT;\n+\n+// get a resource variable\n+$fp = fopen(__FILE__, "r");\n+\n+// add arrays\n+$index_array = array (1, 2, 3);\n+$assoc_array = array (\'one\' => 1, \'two\' => 2);\n+\n+//array of values to iterate over\n+$inputs = array(\n+\n+      // int data\n+      \'int 0\' => 0,\n+      \'int 1\' => 1,\n+      \'int 12345\' => 12345,\n+      \'int -12345\' => -2345,\n+\n+      // float data\n+      \'float 10.5\' => 10.5,\n+      \'float -10.5\' => -10.5,\n+      \'float 12.3456789000e10\' => 12.3456789000e10,\n+      \'float -12.3456789000e10\' => -12.3456789000e10,\n+      \'float .5\' => .5,\n+\n+      // array data\n+      \'empty array\' => array(),\n+      \'int indexed array\' => $index_array,\n+      \'associative array\' => $assoc_array,\n+      \'nested arrays\' => array(\'foo\', $index_array, $assoc_array),\n+\n+      // null data\n+      \'uppercase NULL\' => NULL,\n+      \'lowercase null\' => null,\n+\n+      // boolean data\n+      \'lowercase true\' => true,\n+      \'lowercase false\' =>false,\n+      \'uppercase TRUE\' =>TRUE,\n+      \'uppercase FALSE\' =>FALSE,\n+\n+      // empty data\n+      \'empty string DQ\' => "",\n+      \'empty string SQ\' => \'\',\n+\n+      // object data\n+      \'instance of classWithToString\' => new classWithToString(),\n+      \'instance of classWithoutToString\' => new classWithoutToString(),\n+\n+      // undefined data\n+      \'undefined var\' => @$undefined_var,\n+\n+      // unset data\n+      \'unset var\' => @$unset_var,\n+      \n+      // resource variable\n+      \'resource\' => $fp      \n+);\n+\n+// loop through each element of the array for key\n+\n+foreach($inputs as $valueType =>$value) {\n+      echo "\\n--$valueType--\\n";\n+      var_dump(bin2hex(mcrypt_cbc($cipher, $value, $data, $mode, $iv)));\n+};\n+\n+fclose($fp);\n+\n+?>\n+===DONE===\n+--EXPECTF--\n+*** Testing mcrypt_cbc() : usage variation ***\n+\n+--int 0--\n+string(32) "bc27b3a4e33b531d5983fc7df693cd09"\n+\n+--int 1--\n+string(32) "bc27b3a4e33b531d5983fc7df693cd09"\n+\n+--int 12345--\n+string(32) "d109b7973383127002474ae731c4b3a8"\n+\n+--int -12345--\n+string(32) "3e82a931cedb03a38b91a637ff8c9f9e"\n+\n+--float 10.5--\n+string(32) "de71833586c1d7132a289960ebeeca7a"\n+\n+--float -10.5--\n+string(32) "7d0489dd2e99ae910ecc015573f3dd16"\n+\n+--float 12.3456789000e10--\n+string(32) "978055b42c0506a8947e3c3c8d994baf"\n+\n+--float -12.3456789000e10--\n+string(32) "4aa84ba400c2b8ef467d4d98372b4f4e"\n+\n+--float .5--\n+string(32) "e731dc5059b84e0c8774ac490f77d6e6"\n+\n+--empty array--\n+Error: 2 - mcrypt_cbc() expects parameter 2 to be string, array given, %s(%d)\n+string(0) ""\n+\n+--int indexed array--\n+Error: 2 - mcrypt_cbc() expects parameter 2 to be string, array given, %s(%d)\n+string(0) ""\n+\n+--associative array--\n+Error: 2 - mcrypt_cbc() expects parameter 2 to be string, array given, %s(%d)\n+string(0) ""\n+\n+--nested arrays--\n+Error: 2 - mcrypt_cbc() expects parameter 2 to be string, array given, %s(%d)\n+string(0) ""\n+\n+--uppercase NULL--\n+string(32) "be722a5ffc361d721fbcab1eacc6acf5"\n+\n+--lowercase null--\n+string(32) "be722a5ffc361d721fbcab1eacc6acf5"\n+\n+--lowercase true--\n+string(32) "bc27b3a4e33b531d5983fc7df693cd09"\n+\n+--lowercase false--\n+string(32) "be722a5ffc361d721fbcab1eacc6acf5"\n+\n+--uppercase TRUE--\n+string(32) "bc27b3a4e33b531d5983fc7df693cd09"\n+\n+--uppercase FALSE--\n+string(32) "be722a5ffc361d721fbcab1eacc6acf5"\n+\n+--empty string DQ--\n+string(32) "be722a5ffc361d721fbcab1eacc6acf5"\n+\n+--empty string SQ--\n+string(32) "be722a5ffc361d721fbcab1eacc6acf5"\n+\n+--instance of classWithToString--\n+string(32) "19420fa26f561ee82ed84abbcd2d284b"\n+\n+--instance of classWithoutToString--\n+Error: 2 - mcrypt_cbc() expects parameter 2 to be string, object given, %s(%d)\n+string(0) ""\n+\n+--undefined var--\n+string(32) "be722a5ffc361d721fbcab1eacc6acf5"\n+\n+--unset var--\n+string(32) "be722a5ffc361d721fbcab1eacc6acf5"\n+\n+--resource--\n+Error: 2 - mcrypt_cbc() expects parameter 2 to be string, resource given, %s(%d)\n+string(0) ""\n+===DONE===\n+\ndiff --git a/test_phpt/ext/mcrypt/mcrypt_cbc_variation3.phpt b/test_phpt/ext/mcrypt/mcrypt_cbc_variation3.phpt\nnew file mode 100644\nindex 00000000..5b2398dd\n--- /dev/null\n+++ b/test_phpt/ext/mcrypt/mcrypt_cbc_variation3.phpt\n@@ -0,0 +1,210 @@\n+--TEST--\n+Test mcrypt_cbc() function : usage variation \n+--SKIPIF--\n+<?php \n+if (!extension_loaded("mcrypt")) {\n+\tprint "skip - mcrypt extension not loaded"; \n+}\t \n+?>\n+--FILE--\n+<?php\n+/* Prototype  : string mcrypt_cbc(string cipher, string key, string data, int mode, string iv)\n+ * Description: CBC crypt/decrypt data using key key with cipher cipher starting with iv \n+ * Source code: ext/mcrypt/mcrypt.c\n+ * Alias to functions: \n+ */\n+\n+echo "*** Testing mcrypt_cbc() : usage variation ***\\n";\n+\n+// Define error handler\n+function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {\n+\tif (error_reporting() != 0) {\n+\t\t// report non-silenced errors\n+\t\techo "Error: $err_no - $err_msg, $filename($linenum)\\n";\n+\t}\n+}\n+set_error_handler(\'test_error_handler\');\n+\n+// Initialise function arguments not being substituted (if any)\n+$cipher = MCRYPT_TRIPLEDES;\n+$key = b\'string_val\';\n+$mode = MCRYPT_ENCRYPT;\n+$iv = b\'01234567\';\n+\n+//get an unset variable\n+$unset_var = 10;\n+unset ($unset_var);\n+\n+// define some classes\n+class classWithToString\n+{\n+\tpublic function __toString() {\n+\t\treturn b"Class A object";\n+\t}\n+}\n+\n+class classWithoutToString\n+{\n+}\n+\n+// heredoc string\n+$heredoc = b<<<EOT\n+hello world\n+EOT;\n+\n+// get a resource variable\n+$fp = fopen(__FILE__, "r");\n+\n+// add arrays\n+$index_array = array (1, 2, 3);\n+$assoc_array = array (\'one\' => 1, \'two\' => 2);\n+\n+//array of values to iterate over\n+$inputs = array(\n+\n+      // int data\n+      \'int 0\' => 0,\n+      \'int 1\' => 1,\n+      \'int 12345\' => 12345,\n+      \'int -12345\' => -2345,\n+\n+      // float data\n+      \'float 10.5\' => 10.5,\n+      \'float -10.5\' => -10.5,\n+      \'float 12.3456789000e10\' => 12.3456789000e10,\n+      \'float -12.3456789000e10\' => -12.3456789000e10,\n+      \'float .5\' => .5,\n+\n+      // array data\n+      \'empty array\' => array(),\n+      \'int indexed array\' => $index_array,\n+      \'associative array\' => $assoc_array,\n+      \'nested arrays\' => array(\'foo\', $index_array, $assoc_array),\n+\n+      // null data\n+      \'uppercase NULL\' => NULL,\n+      \'lowercase null\' => null,\n+\n+      // boolean data\n+      \'lowercase true\' => true,\n+      \'lowercase false\' =>false,\n+      \'uppercase TRUE\' =>TRUE,\n+      \'uppercase FALSE\' =>FALSE,\n+\n+      // empty data\n+      \'empty string DQ\' => "",\n+      \'empty string SQ\' => \'\',\n+\n+      // object data\n+      \'instance of classWithToString\' => new classWithToString(),\n+      \'instance of classWithoutToString\' => new classWithoutToString(),\n+\n+      // undefined data\n+      \'undefined var\' => @$undefined_var,\n+\n+      // unset data\n+      \'unset var\' => @$unset_var,\n+      \n+      // resource variable\n+      \'resource\' => $fp      \n+);\n+\n+// loop through each element of the array for data\n+\n+foreach($inputs as $valueType =>$value) {\n+      echo "\\n--$valueType--\\n";\n+      var_dump(bin2hex(mcrypt_cbc($cipher, $key, $value, $mode, $iv)));\n+};\n+\n+fclose($fp);\n+\n+?>\n+===DONE===\n+--EXPECTF--\n+*** Testing mcrypt_cbc() : usage variation ***\n+\n+--int 0--\n+string(16) "ce5fcfe737859795"\n+\n+--int 1--\n+string(16) "84df495f6cd82dd9"\n+\n+--int 12345--\n+string(16) "905ab1ae27ee9991"\n+\n+--int -12345--\n+string(16) "5835174e9c67c3e7"\n+\n+--float 10.5--\n+string(16) "28ff0601ad9e47fa"\n+\n+--float -10.5--\n+string(16) "ce9f2b6e2fc3d9f7"\n+\n+--float 12.3456789000e10--\n+string(32) "24eb882ce9763e4018fba9b7f01b0c3e"\n+\n+--float -12.3456789000e10--\n+string(32) "5eed30e428f32de1d7a7064d0ed4d3eb"\n+\n+--float .5--\n+string(16) "bebf2a13676e1e30"\n+\n+--empty array--\n+Error: 2 - mcrypt_cbc() expects parameter 3 to be string, array given, %s(%d)\n+string(0) ""\n+\n+--int indexed array--\n+Error: 2 - mcrypt_cbc() expects parameter 3 to be string, array given, %s(%d)\n+string(0) ""\n+\n+--associative array--\n+Error: 2 - mcrypt_cbc() expects parameter 3 to be string, array given, %s(%d)\n+string(0) ""\n+\n+--nested arrays--\n+Error: 2 - mcrypt_cbc() expects parameter 3 to be string, array given, %s(%d)\n+string(0) ""\n+\n+--uppercase NULL--\n+string(16) "206f6d3617a5ab32"\n+\n+--lowercase null--\n+string(16) "206f6d3617a5ab32"\n+\n+--lowercase true--\n+string(16) "84df495f6cd82dd9"\n+\n+--lowercase false--\n+string(16) "206f6d3617a5ab32"\n+\n+--uppercase TRUE--\n+string(16) "84df495f6cd82dd9"\n+\n+--uppercase FALSE--\n+string(16) "206f6d3617a5ab32"\n+\n+--empty string DQ--\n+string(16) "206f6d3617a5ab32"\n+\n+--empty string SQ--\n+string(16) "206f6d3617a5ab32"\n+\n+--instance of classWithToString--\n+string(32) "7c91cdf8f8c51485034a9ee528eb016b"\n+\n+--instance of classWithoutToString--\n+Error: 2 - mcrypt_cbc() expects parameter 3 to be string, object given, %s(%d)\n+string(0) ""\n+\n+--undefined var--\n+string(16) "206f6d3617a5ab32"\n+\n+--unset var--\n+string(16) "206f6d3617a5ab32"\n+\n+--resource--\n+Error: 2 - mcrypt_cbc() expects parameter 3 to be string, resource given, %s(%d)\n+string(0) ""\n+===DONE===\n+\ndiff --git a/test_phpt/ext/mcrypt/mcrypt_cbc_variation4.phpt b/test_phpt/ext/mcrypt/mcrypt_cbc_variation4.phpt\nnew file mode 100644\nindex 00000000..f9a511f3\n--- /dev/null\n+++ b/test_phpt/ext/mcrypt/mcrypt_cbc_variation4.phpt\n@@ -0,0 +1,205 @@\n+--TEST--\n+Test mcrypt_cbc() function : usage variation \n+--SKIPIF--\n+<?php \n+if (!extension_loaded("mcrypt")) {\n+\tprint "skip - mcrypt extension not loaded"; \n+}\t \n+?>\n+--FILE--\n+<?php\n+/* Prototype  : string mcrypt_cbc(string cipher, string key, string data, int mode, string iv)\n+ * Description: CBC crypt/decrypt data using key key with cipher cipher starting with iv \n+ * Source code: ext/mcrypt/mcrypt.c\n+ * Alias to functions: \n+ */\n+\n+echo "*** Testing mcrypt_cbc() : usage variation ***\\n";\n+\n+// Define error handler\n+function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {\n+\tif (error_reporting() != 0) {\n+\t\t// report non-silenced errors\n+\t\techo "Error: $err_no - $err_msg, $filename($linenum)\\n";\n+\t}\n+}\n+set_error_handler(\'test_error_handler\');\n+\n+// Initialise function arguments not being substituted (if any)\n+$cipher = MCRYPT_TRIPLEDES;\n+$key = b\'string_val\';\n+$data = b\'string_val\';\n+$iv = b\'01234567\';\n+\n+//get an unset variable\n+$unset_var = 10;\n+unset ($unset_var);\n+\n+// define some classes\n+class classWithToString\n+{\n+\tpublic function __toString() {\n+\t\treturn "Class A object";\n+\t}\n+}\n+\n+class classWithoutToString\n+{\n+}\n+\n+// heredoc string\n+$heredoc = <<<EOT\n+hello world\n+EOT;\n+\n+// get a resource variable\n+$fp = fopen(__FILE__, "r");\n+\n+// add arrays\n+$index_array = array (1, 2, 3);\n+$assoc_array = array (\'one\' => 1, \'two\' => 2);\n+\n+//array of values to iterate over\n+$inputs = array(\n+\n+      // float data\n+      \'float 10.5\' => 10.5,\n+      \'float -10.5\' => -10.5,\n+      \'float 12.3456789000e10\' => 12.3456789000e10,\n+      \'float -12.3456789000e10\' => -12.3456789000e10,\n+      \'float .5\' => .5,\n+\n+      // array data\n+      \'empty array\' => array(),\n+      \'int indexed array\' => $index_array,\n+      \'associative array\' => $assoc_array,\n+      \'nested arrays\' => array(\'foo\', $index_array, $assoc_array),\n+\n+      // null data\n+      \'uppercase NULL\' => NULL,\n+      \'lowercase null\' => null,\n+\n+      // boolean data\n+      \'lowercase true\' => true,\n+      \'lowercase false\' =>false,\n+      \'uppercase TRUE\' =>TRUE,\n+      \'uppercase FALSE\' =>FALSE,\n+\n+      // empty data\n+      \'empty string DQ\' => "",\n+      \'empty string SQ\' => \'\',\n+\n+      // string data\n+      \'string DQ\' => "string",\n+      \'string SQ\' => \'string\',\n+      \'mixed case string\' => "sTrInG",\n+      \'heredoc\' => $heredoc,\n+\n+      // object data\n+      \'instance of classWithToString\' => new classWithToString(),\n+      \'instance of classWithoutToString\' => new classWithoutToString(),\n+\n+      // undefined data\n+      \'undefined var\' => @$undefined_var,\n+\n+      // unset data\n+      \'unset var\' => @$unset_var,\n+      \n+      // resource variable\n+      \'resource\' => $fp      \n+);\n+\n+// loop through each element of the array for mode\n+\n+foreach($inputs as $valueType =>$value) {\n+      echo "\\n--$valueType--\\n";\n+      var_dump(bin2hex(mcrypt_cbc($cipher, $key, $data, $value, $iv)));\n+};\n+\n+fclose($fp);\n+\n+?>\n+===DONE===\n+--EXPECTF--\n+*** Testing mcrypt_cbc() : usage variation ***\n+\n+--float 10.5--\n+string(32) "983d5edc5f77fe42e2372a0339dc22b0"\n+\n+--float -10.5--\n+string(32) "983d5edc5f77fe42e2372a0339dc22b0"\n+\n+--float 12.3456789000e10--\n+string(32) "983d5edc5f77fe42e2372a0339dc22b0"\n+\n+--float -12.3456789000e10--\n+string(32) "983d5edc5f77fe42e2372a0339dc22b0"\n+\n+--float .5--\n+string(32) "5f781523f696d596e4b809d72197a0cc"\n+\n+--empty array--\n+string(32) "5f781523f696d596e4b809d72197a0cc"\n+\n+--int indexed array--\n+string(32) "983d5edc5f77fe42e2372a0339dc22b0"\n+\n+--associative array--\n+string(32) "983d5edc5f77fe42e2372a0339dc22b0"\n+\n+--nested arrays--\n+string(32) "983d5edc5f77fe42e2372a0339dc22b0"\n+\n+--uppercase NULL--\n+string(32) "5f781523f696d596e4b809d72197a0cc"\n+\n+--lowercase null--\n+string(32) "5f781523f696d596e4b809d72197a0cc"\n+\n+--lowercase true--\n+string(32) "983d5edc5f77fe42e2372a0339dc22b0"\n+\n+--lowercase false--\n+string(32) "5f781523f696d596e4b809d72197a0cc"\n+\n+--uppercase TRUE--\n+string(32) "983d5edc5f77fe42e2372a0339dc22b0"\n+\n+--uppercase FALSE--\n+string(32) "5f781523f696d596e4b809d72197a0cc"\n+\n+--empty string DQ--\n+string(32) "5f781523f696d596e4b809d72197a0cc"\n+\n+--empty string SQ--\n+string(32) "5f781523f696d596e4b809d72197a0cc"\n+\n+--string DQ--\n+string(32) "5f781523f696d596e4b809d72197a0cc"\n+\n+--string SQ--\n+string(32) "5f781523f696d596e4b809d72197a0cc"\n+\n+--mixed case string--\n+string(32) "5f781523f696d596e4b809d72197a0cc"\n+\n+--heredoc--\n+string(32) "5f781523f696d596e4b809d72197a0cc"\n+\n+--instance of classWithToString--\n+Error: 8 - Object of class classWithToString could not be converted to int, %s(%d)\n+string(32) "983d5edc5f77fe42e2372a0339dc22b0"\n+\n+--instance of classWithoutToString--\n+Error: 8 - Object of class classWithoutToString could not be converted to int, %s(%d)\n+string(32) "983d5edc5f77fe42e2372a0339dc22b0"\n+\n+--undefined var--\n+string(32) "5f781523f696d596e4b809d72197a0cc"\n+\n+--unset var--\n+string(32) "5f781523f696d596e4b809d72197a0cc"\n+\n+--resource--\n+string(%d) %s\n+===DONE===\ndiff --git a/test_phpt/ext/mcrypt/mcrypt_cbc_variation5.phpt b/test_phpt/ext/mcrypt/mcrypt_cbc_variation5.phpt\nnew file mode 100644\nindex 00000000..7d49db85\n--- /dev/null\n+++ b/test_phpt/ext/mcrypt/mcrypt_cbc_variation5.phpt\n@@ -0,0 +1,230 @@\n+--TEST--\n+Test mcrypt_cbc() function : usage variation\n+--SKIPIF--\n+<?php \n+if (!extension_loaded("mcrypt")) {\n+\tprint "skip - mcrypt extension not loaded"; \n+}\t \n+?> \n+--FILE--\n+<?php\n+/* Prototype  : string mcrypt_cbc(string cipher, string key, string data, int mode, string iv)\n+ * Description: CBC crypt/decrypt data using key key with cipher cipher starting with iv \n+ * Source code: ext/mcrypt/mcrypt.c\n+ * Alias to functions: \n+ */\n+\n+echo "*** Testing mcrypt_cbc() : usage variation ***\\n";\n+\n+// Define error handler\n+function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {\n+\tif (error_reporting() != 0) {\n+\t\t// report non-silenced errors\n+\t\techo "Error: $err_no - $err_msg, $filename($linenum)\\n";\n+\t}\n+}\n+set_error_handler(\'test_error_handler\');\n+\n+// Initialise function arguments not being substituted (if any)\n+$cipher = MCRYPT_TRIPLEDES;\n+$key = b\'string_val\';\n+$data = b\'string_val\';\n+$mode = MCRYPT_ENCRYPT;\n+\n+//get an unset variable\n+$unset_var = 10;\n+unset ($unset_var);\n+\n+// define some classes\n+class classWithToString\n+{\n+\tpublic function __toString() {\n+\t\treturn b"Class A object";\n+\t}\n+}\n+\n+class classWithoutToString\n+{\n+}\n+\n+// heredoc string\n+$heredoc = b<<<EOT\n+hello world\n+EOT;\n+\n+// get a resource variable\n+$fp = fopen(__FILE__, "r");\n+\n+// add arrays\n+$index_array = array (1, 2, 3);\n+$assoc_array = array (\'one\' => 1, \'two\' => 2);\n+\n+//array of values to iterate over\n+$inputs = array(\n+\n+      // int data\n+      \'int 0\' => 0,\n+      \'int 1\' => 1,\n+      \'int 12345\' => 12345,\n+      \'int -12345\' => -2345,\n+\n+      // float data\n+      \'float 10.5\' => 10.5,\n+      \'float -10.5\' => -10.5,\n+      \'float 12.3456789000e10\' => 12.3456789000e10,\n+      \'float -12.3456789000e10\' => -12.3456789000e10,\n+      \'float .5\' => .5,\n+\n+      // array data\n+      \'empty array\' => array(),\n+      \'int indexed array\' => $index_array,\n+      \'associative array\' => $assoc_array,\n+      \'nested arrays\' => array(\'foo\', $index_array, $assoc_array),\n+\n+      // null data\n+      \'uppercase NULL\' => NULL,\n+      \'lowercase null\' => null,\n+\n+      // boolean data\n+      \'lowercase true\' => true,\n+      \'lowercase false\' =>false,\n+      \'uppercase TRUE\' =>TRUE,\n+      \'uppercase FALSE\' =>FALSE,\n+\n+      // empty data\n+      \'empty string DQ\' => "",\n+      \'empty string SQ\' => \'\',\n+\n+      // object data\n+      \'instance of classWithToString\' => new classWithToString(),\n+      \'instance of classWithoutToString\' => new classWithoutToString(),\n+\n+      // undefined data\n+      \'undefined var\' => @$undefined_var,\n+\n+      // unset data\n+      \'unset var\' => @$unset_var,\n+      \n+      // resource variable\n+      \'resource\' => $fp      \n+);\n+\n+// loop through each element of the array for iv\n+\n+foreach($inputs as $valueType =>$value) {\n+      echo "\\n--$valueType--\\n";\n+      var_dump( bin2hex(mcrypt_cbc($cipher, $key, $data, $mode, $value)) );\n+};\n+\n+fclose($fp);\n+\n+?>\n+===DONE===\n+--EXPECTF--\n+*** Testing mcrypt_cbc() : usage variation ***\n+\n+--int 0--\n+Error: 2 - mcrypt_cbc(): The IV parameter must be as long as the blocksize, %s(%d)\n+string(32) "6438db90653c4d3080c3ceab43618c05"\n+\n+--int 1--\n+Error: 2 - mcrypt_cbc(): The IV parameter must be as long as the blocksize, %s(%d)\n+string(32) "6438db90653c4d3080c3ceab43618c05"\n+\n+--int 12345--\n+Error: 2 - mcrypt_cbc(): The IV parameter must be as long as the blocksize, %s(%d)\n+string(32) "6438db90653c4d3080c3ceab43618c05"\n+\n+--int -12345--\n+Error: 2 - mcrypt_cbc(): The IV parameter must be as long as the blocksize, %s(%d)\n+string(32) "6438db90653c4d3080c3ceab43618c05"\n+\n+--float 10.5--\n+Error: 2 - mcrypt_cbc(): The IV parameter must be as long as the blocksize, %s(%d)\n+string(32) "6438db90653c4d3080c3ceab43618c05"\n+\n+--float -10.5--\n+Error: 2 - mcrypt_cbc(): The IV parameter must be as long as the blocksize, %s(%d)\n+string(32) "6438db90653c4d3080c3ceab43618c05"\n+\n+--float 12.3456789000e10--\n+Error: 2 - mcrypt_cbc(): The IV parameter must be as long as the blocksize, %s(%d)\n+string(32) "6438db90653c4d3080c3ceab43618c05"\n+\n+--float -12.3456789000e10--\n+Error: 2 - mcrypt_cbc(): The IV parameter must be as long as the blocksize, %s(%d)\n+string(32) "6438db90653c4d3080c3ceab43618c05"\n+\n+--float .5--\n+Error: 2 - mcrypt_cbc(): The IV parameter must be as long as the blocksize, %s(%d)\n+string(32) "6438db90653c4d3080c3ceab43618c05"\n+\n+--empty array--\n+Error: 2 - mcrypt_cbc() expects parameter 5 to be string, array given, %s(%d)\n+string(0) ""\n+\n+--int indexed array--\n+Error: 2 - mcrypt_cbc() expects parameter 5 to be string, array given, %s(%d)\n+string(0) ""\n+\n+--associative array--\n+Error: 2 - mcrypt_cbc() expects parameter 5 to be string, array given, %s(%d)\n+string(0) ""\n+\n+--nested arrays--\n+Error: 2 - mcrypt_cbc() expects parameter 5 to be string, array given, %s(%d)\n+string(0) ""\n+\n+--uppercase NULL--\n+Error: 2 - mcrypt_cbc(): The IV parameter must be as long as the blocksize, %s(%d)\n+string(32) "6438db90653c4d3080c3ceab43618c05"\n+\n+--lowercase null--\n+Error: 2 - mcrypt_cbc(): The IV parameter must be as long as the blocksize, %s(%d)\n+string(32) "6438db90653c4d3080c3ceab43618c05"\n+\n+--lowercase true--\n+Error: 2 - mcrypt_cbc(): The IV parameter must be as long as the blocksize, %s(%d)\n+string(32) "6438db90653c4d3080c3ceab43618c05"\n+\n+--lowercase false--\n+Error: 2 - mcrypt_cbc(): The IV parameter must be as long as the blocksize, %s(%d)\n+string(32) "6438db90653c4d3080c3ceab43618c05"\n+\n+--uppercase TRUE--\n+Error: 2 - mcrypt_cbc(): The IV parameter must be as long as the blocksize, %s(%d)\n+string(32) "6438db90653c4d3080c3ceab43618c05"\n+\n+--uppercase FALSE--\n+Error: 2 - mcrypt_cbc(): The IV parameter must be as long as the blocksize, %s(%d)\n+string(32) "6438db90653c4d3080c3ceab43618c05"\n+\n+--empty string DQ--\n+Error: 2 - mcrypt_cbc(): The IV parameter must be as long as the blocksize, %s(%d)\n+string(32) "6438db90653c4d3080c3ceab43618c05"\n+\n+--empty string SQ--\n+Error: 2 - mcrypt_cbc(): The IV parameter must be as long as the blocksize, %s(%d)\n+string(32) "6438db90653c4d3080c3ceab43618c05"\n+\n+--instance of classWithToString--\n+Error: 2 - mcrypt_cbc(): The IV parameter must be as long as the blocksize, %s(%d)\n+string(32) "6438db90653c4d3080c3ceab43618c05"\n+\n+--instance of classWithoutToString--\n+Error: 2 - mcrypt_cbc() expects parameter 5 to be string, object given, %s(%d)\n+string(0) ""\n+\n+--undefined var--\n+Error: 2 - mcrypt_cbc(): The IV parameter must be as long as the blocksize, %s(%d)\n+string(32) "6438db90653c4d3080c3ceab43618c05"\n+\n+--unset var--\n+Error: 2 - mcrypt_cbc(): The IV parameter must be as long as the blocksize, %s(%d)\n+string(32) "6438db90653c4d3080c3ceab43618c05"\n+\n+--resource--\n+Error: 2 - mcrypt_cbc() expects parameter 5 to be string, resource given, %s(%d)\n+string(0) ""\n+===DONE===\n+\ndiff --git a/test_phpt/ext/mcrypt/mcrypt_cfb.phpt b/test_phpt/ext/mcrypt/mcrypt_cfb.phpt\nnew file mode 100644\nindex 00000000..54919c85\n--- /dev/null\n+++ b/test_phpt/ext/mcrypt/mcrypt_cfb.phpt\n@@ -0,0 +1,23 @@\n+--TEST--\n+mcrypt_cfb\n+--SKIPIF--\n+<?php if (!extension_loaded("mcrypt")) print "skip"; ?>\n+--FILE--\n+<?php\n+$key      = "FooBar";\n+$secret   = "PHP Testfest 2008";\n+$cipher   = MCRYPT_RIJNDAEL_128;\n+\n+$iv       = mcrypt_create_iv(mcrypt_get_iv_size($cipher, MCRYPT_MODE_CFB), MCRYPT_RAND);\n+$enc_data = mcrypt_cfb($cipher, $key, $secret, MCRYPT_ENCRYPT, $iv);\n+\n+// we have to trim as AES rounds the blocks and decrypt doesnt detect that\n+echo trim(mcrypt_cfb($cipher, $key, $enc_data, MCRYPT_DECRYPT, $iv)) . "\\n";\n+\n+// a warning must be issued if we don\'t use a IV on a AES cipher, that usually requires an IV\n+mcrypt_cfb($cipher, $key, $enc_data, MCRYPT_DECRYPT);\n+\n+--EXPECTF--\n+PHP Testfest 2008\n+\n+Warning: mcrypt_cfb(): Attempt to use an empty IV, which is NOT recommend in %s on line %d\ndiff --git a/test_phpt/ext/mcrypt/mcrypt_create_iv.phpt b/test_phpt/ext/mcrypt/mcrypt_create_iv.phpt\nnew file mode 100644\nindex 00000000..1aa48868\n--- /dev/null\n+++ b/test_phpt/ext/mcrypt/mcrypt_create_iv.phpt\n@@ -0,0 +1,17 @@\n+--TEST--\n+mcrypt_create_iv\n+--SKIPIF--\n+<?php if (!extension_loaded("mcrypt")) print "skip"; ?>\n+--FILE--\n+<?php\n+$iv1 = mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_ECB), MCRYPT_RAND);\n+$iv2 = mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_ECB), MCRYPT_DEV_URANDOM);\n+$iv3 = mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_ECB), MCRYPT_DEV_RANDOM);\n+\n+echo strlen($iv1) . "\\n";\n+echo strlen($iv2) . "\\n";\n+echo strlen($iv3) . "\\n";\n+--EXPECT--\n+16\n+16\n+16\ndiff --git a/test_phpt/ext/mcrypt/mcrypt_decrypt.phpt b/test_phpt/ext/mcrypt/mcrypt_decrypt.phpt\nnew file mode 100644\nindex 00000000..b4e62840\n--- /dev/null\n+++ b/test_phpt/ext/mcrypt/mcrypt_decrypt.phpt\n@@ -0,0 +1,28 @@\n+--TEST--\n+mcrypt_decrypt\n+--SKIPIF--\n+<?php if (!extension_loaded("mcrypt")) print "skip"; ?>\n+--FILE--\n+<?php\n+$key      = "FooBar";\n+$secret   = "PHP Testfest 2008";\n+$mode     = MCRYPT_MODE_CBC;\n+$cipher   = MCRYPT_RIJNDAEL_128;\n+\n+$iv       = mcrypt_create_iv(mcrypt_get_iv_size($cipher, $mode), MCRYPT_RAND);\n+$enc_data = mcrypt_encrypt($cipher, $key, $secret, $mode, $iv);\n+\n+// we have to trim as AES rounds the blocks and decrypt doesnt detect that\n+echo trim(mcrypt_decrypt($cipher, $key, $enc_data, $mode, $iv)) . "\\n";\n+\n+// a warning must be issued if we don\'t use a IV on a AES cipher, that usually requires an IV\n+mcrypt_decrypt($cipher, $key, $enc_data, MCRYPT_MODE_CBC);\n+\n+var_dump(strpos(mcrypt_decrypt(MCRYPT_BLOWFISH, "FooBar", $enc_data, MCRYPT_MODE_CBC, $iv), "Testfest") !== false);\n+--EXPECTF--\n+PHP Testfest 2008\n+\n+Warning: mcrypt_decrypt(): Attempt to use an empty IV, which is NOT recommend in %s on line %d\n+\n+Warning: mcrypt_decrypt(): The IV parameter must be as long as the blocksize in %s on line %d\n+bool(false)\n\\ No newline at end of file\ndiff --git a/test_phpt/ext/mcrypt/mcrypt_decrypt_3des_cbc.phpt b/test_phpt/ext/mcrypt/mcrypt_decrypt_3des_cbc.phpt\nnew file mode 100644\nindex 00000000..30d0c2ba\n--- /dev/null\n+++ b/test_phpt/ext/mcrypt/mcrypt_decrypt_3des_cbc.phpt\n@@ -0,0 +1,101 @@\n+--TEST--\n+Test mcrypt_decrypt() function : basic functionality \n+--SKIPIF--\n+<?php \n+if (!extension_loaded("mcrypt")) {\n+\tprint "skip - mcrypt extension not loaded"; \n+}\t \n+?>\n+--FILE--\n+<?php\n+/* Prototype  : string mcrypt_decrypt(string cipher, string key, string data, string mode, string iv)\n+ * Description: OFB crypt/decrypt data using key key with cipher cipher starting with iv \n+ * Source code: ext/mcrypt/mcrypt.c\n+ * Alias to functions: \n+ */\n+\n+echo "*** Testing mcrypt_decrypt() : basic functionality ***\\n";\n+\n+\n+// Initialise all required variables\n+$cipher = MCRYPT_3DES;\n+$mode = MCRYPT_MODE_CBC;\n+\n+// tripledes uses keys upto 192 bits (24 bytes)\n+$keys = array(\n+   b\'12345678\', \n+   b\'12345678901234567890\', \n+   b\'123456789012345678901234\', \n+   b\'12345678901234567890123456\'\n+);\n+$data1 = array(\n+   \'IleMhoxiOthmHua4tFBHOw==\',\n+   \'EeF1s6C+w1IiHj1gdDn81g==\',\n+   \'EEuXpjZPueyYoG0LGQ199Q==\',\n+   \'EEuXpjZPueyYoG0LGQ199Q==\'\n+);\n+// tripledes is a block cipher of 64 bits (8 bytes)\n+$ivs = array(\n+   b\'1234\', \n+   b\'12345678\', \n+   b\'123456789\'\n+);\n+$data2 = array(\n+   \'+G7nGcWIxij3TZjpI9lJdQ==\',\n+   \'3bJiFMeyScxOLQcE6mZtLg==\',\n+   \'+G7nGcWIxij3TZjpI9lJdQ==\'\n+);\n+\n+$iv = b\'12345678\';\n+echo "\\n--- testing different key lengths\\n";\n+for ($i = 0; $i < sizeof($keys); $i++) {\n+   echo "\\nkey length=".strlen($keys[$i])."\\n";\n+   special_var_dump(mcrypt_decrypt($cipher, $keys[$i], base64_decode($data1[$i]), $mode, $iv));\n+}\n+\n+$key = b\'1234567890123456\';  \n+echo "\\n--- testing different iv lengths\\n";\n+for ($i = 0; $i < sizeof($ivs); $i++) {\n+   echo "\\niv length=".strlen($ivs[$i])."\\n";\n+   special_var_dump(mcrypt_decrypt($cipher, $key, base64_decode($data2[$i]), $mode, $ivs[$i]));\n+}\n+\n+function special_var_dump($str) {\n+   var_dump(bin2hex($str));\n+}  \n+?>\n+===DONE===\n+--EXPECTF--\n+*** Testing mcrypt_decrypt() : basic functionality ***\n+\n+--- testing different key lengths\n+\n+key length=8\n+string(32) "736563726574206d6573736167650000"\n+\n+key length=20\n+string(32) "736563726574206d6573736167650000"\n+\n+key length=24\n+string(32) "736563726574206d6573736167650000"\n+\n+key length=26\n+\n+Warning: mcrypt_decrypt(): Size of key is too large for this algorithm in %s on line %d\n+string(32) "736563726574206d6573736167650000"\n+\n+--- testing different iv lengths\n+\n+iv length=4\n+\n+Warning: mcrypt_decrypt(): The IV parameter must be as long as the blocksize in %s on line %d\n+string(32) "736563726574206d6573736167650000"\n+\n+iv length=8\n+string(32) "736563726574206d6573736167650000"\n+\n+iv length=9\n+\n+Warning: mcrypt_decrypt(): The IV parameter must be as long as the blocksize in %s on line %d\n+string(32) "736563726574206d6573736167650000"\n+===DONE===\ndiff --git a/test_phpt/ext/mcrypt/mcrypt_decrypt_3des_ecb.phpt b/test_phpt/ext/mcrypt/mcrypt_decrypt_3des_ecb.phpt\nnew file mode 100644\nindex 00000000..5f841c1b\n--- /dev/null\n+++ b/test_phpt/ext/mcrypt/mcrypt_decrypt_3des_ecb.phpt\n@@ -0,0 +1,96 @@\n+--TEST--\n+Test mcrypt_decrypt() function : basic functionality \n+--SKIPIF--\n+<?php \n+if (!extension_loaded("mcrypt")) {\n+\tprint "skip - mcrypt extension not loaded"; \n+}\t \n+?>\n+--FILE--\n+<?php\n+/* Prototype  : string mcrypt_decrypt(string cipher, string key, string data, string mode, string iv)\n+ * Description: OFB crypt/decrypt data using key key with cipher cipher starting with iv \n+ * Source code: ext/mcrypt/mcrypt.c\n+ * Alias to functions: \n+ */\n+\n+echo "*** Testing mcrypt_decrypt() : basic functionality ***\\n";\n+\n+\n+// Initialise all required variables\n+$cipher = MCRYPT_3DES;\n+$mode = MCRYPT_MODE_ECB;\n+\n+// tripledes uses keys upto 192 bits (24 bytes)\n+$keys = array(\n+   b\'12345678\', \n+   b\'12345678901234567890\', \n+   b\'123456789012345678901234\', \n+   b\'12345678901234567890123456\'\n+);\n+$data1 = array(\n+   \'0D4ArM3ejyhic9rnCcIW9A==\',\n+   \'q0wt1YeOjLpnKm5WsrzKEw==\',\n+   \'zwKEFeqHkhlj+7HZTRA/yA==\',\n+   \'zwKEFeqHkhlj+7HZTRA/yA==\'\n+);\n+// tripledes is a block cipher of 64 bits (8 bytes)\n+$ivs = array(\n+   b\'1234\', \n+   b\'12345678\', \n+   b\'123456789\'\n+);\n+$data2 = array(\n+   \'+G7nGcWIxigQcJD+2P14HA==\',\n+   \'+G7nGcWIxigQcJD+2P14HA==\',\n+   \'+G7nGcWIxigQcJD+2P14HA==\'\n+);\n+\n+echo "\\n--- testing different key lengths\\n";\n+for ($i = 0; $i < sizeof($keys); $i++) {\n+   echo "\\nkey length=".strlen($keys[$i])."\\n";\n+   special_var_dump(mcrypt_decrypt($cipher, $keys[$i], base64_decode($data1[$i]), $mode));\n+}\n+\n+$key = b\'1234567890123456\';  \n+echo "\\n--- testing different iv lengths\\n";\n+for ($i = 0; $i < sizeof($ivs); $i++) {\n+   echo "\\niv length=".strlen($ivs[$i])."\\n";\n+   special_var_dump(mcrypt_decrypt($cipher, $key, base64_decode($data2[$i]), $mode, $ivs[$i]));\n+}\n+\n+function special_var_dump($str) {\n+   var_dump(bin2hex($str));\n+}  \n+?>\n+===DONE===\n+--EXPECTF--\n+*** Testing mcrypt_decrypt() : basic functionality ***\n+\n+--- testing different key lengths\n+\n+key length=8\n+string(32) "736563726574206d6573736167650000"\n+\n+key length=20\n+string(32) "736563726574206d6573736167650000"\n+\n+key length=24\n+string(32) "736563726574206d6573736167650000"\n+\n+key length=26\n+\n+Warning: mcrypt_decrypt(): Size of key is too large for this algorithm in %s on line %d\n+string(32) "736563726574206d6573736167650000"\n+\n+--- testing different iv lengths\n+\n+iv length=4\n+string(32) "736563726574206d6573736167650000"\n+\n+iv length=8\n+string(32) "736563726574206d6573736167650000"\n+\n+iv length=9\n+string(32) "736563726574206d6573736167650000"\n+===DONE===\ndiff --git a/test_phpt/ext/mcrypt/mcrypt_decrypt_error.phpt b/test_phpt/ext/mcrypt/mcrypt_decrypt_error.phpt\nnew file mode 100644\nindex 00000000..aae42d83\n--- /dev/null\n+++ b/test_phpt/ext/mcrypt/mcrypt_decrypt_error.phpt\n@@ -0,0 +1,52 @@\n+--TEST--\n+Test mcrypt_decrypt() function : error conditions \n+--SKIPIF--\n+<?php \n+if (!extension_loaded("mcrypt")) {\n+\tprint "skip - mcrypt extension not loaded"; \n+}\t \n+?>\n+--FILE--\n+<?php\n+/* Prototype  : string mcrypt_decrypt(string cipher, string key, string data, string mode, string iv)\n+ * Description: OFB crypt/decrypt data using key key with cipher cipher starting with iv \n+ * Source code: ext/mcrypt/mcrypt.c\n+ * Alias to functions: \n+ */\n+\n+echo "*** Testing mcrypt_decrypt() : error conditions ***\\n";\n+\n+\n+//Test mcrypt_decrypt with one more than the expected number of arguments\n+echo "\\n-- Testing mcrypt_decrypt() function with more than expected no. of arguments --\\n";\n+$cipher = \'string_val\';\n+$key = \'string_val\';\n+$data = \'string_val\';\n+$mode = \'string_val\';\n+$iv = \'string_val\';\n+$extra_arg = 10;\n+var_dump( mcrypt_decrypt($cipher, $key, $data, $mode, $iv, $extra_arg) );\n+\n+// Testing mcrypt_decrypt with one less than the expected number of arguments\n+echo "\\n-- Testing mcrypt_decrypt() function with less than expected no. of arguments --\\n";\n+$cipher = \'string_val\';\n+$key = \'string_val\';\n+$data = \'string_val\';\n+var_dump( mcrypt_decrypt($cipher, $key, $data) );\n+\n+?>\n+===DONE===\n+--EXPECTF--\n+*** Testing mcrypt_decrypt() : error conditions ***\n+\n+-- Testing mcrypt_decrypt() function with more than expected no. of arguments --\n+\n+Warning: mcrypt_decrypt() expects at most 5 parameters, 6 given in %s on line %d\n+NULL\n+\n+-- Testing mcrypt_decrypt() function with less than expected no. of arguments --\n+\n+Warning: mcrypt_decrypt() expects at least 4 parameters, 3 given in %s on line %d\n+NULL\n+===DONE===\n+\ndiff --git a/test_phpt/ext/mcrypt/mcrypt_decrypt_variation1.phpt b/test_phpt/ext/mcrypt/mcrypt_decrypt_variation1.phpt\nnew file mode 100644\nindex 00000000..21fda197\n--- /dev/null\n+++ b/test_phpt/ext/mcrypt/mcrypt_decrypt_variation1.phpt\n@@ -0,0 +1,230 @@\n+--TEST--\n+Test mcrypt_decrypt() function : usage variation \n+--SKIPIF--\n+<?php \n+if (!extension_loaded("mcrypt")) {\n+\tprint "skip - mcrypt extension not loaded"; \n+}\t \n+?>\n+--FILE--\n+<?php\n+/* Prototype  : string mcrypt_decrypt(string cipher, string key, string data, string mode, string iv)\n+ * Description: OFB crypt/decrypt data using key key with cipher cipher starting with iv \n+ * Source code: ext/mcrypt/mcrypt.c\n+ * Alias to functions: \n+ */\n+\n+echo "*** Testing mcrypt_decrypt() : usage variation ***\\n";\n+\n+// Define error handler\n+function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {\n+\tif (error_reporting() != 0) {\n+\t\t// report non-silenced errors\n+\t\techo "Error: $err_no - $err_msg, $filename($linenum)\\n";\n+\t}\n+}\n+set_error_handler(\'test_error_handler\');\n+\n+// Initialise function arguments not being substituted (if any)\n+$key = b\'string_val\';\n+$data = b\'string_val\';\n+$mode = MCRYPT_MODE_ECB;\n+$iv = b\'string_val\';\n+\n+//get an unset variable\n+$unset_var = 10;\n+unset ($unset_var);\n+\n+// define some classes\n+class classWithToString\n+{\n+\tpublic function __toString() {\n+\t\treturn "Class A object";\n+\t}\n+}\n+\n+class classWithoutToString\n+{\n+}\n+\n+// heredoc string\n+$heredoc = <<<EOT\n+hello world\n+EOT;\n+\n+// get a resource variable\n+$fp = fopen(__FILE__, "r");\n+\n+// add arrays\n+$index_array = array (1, 2, 3);\n+$assoc_array = array (\'one\' => 1, \'two\' => 2);\n+\n+//array of values to iterate over\n+$inputs = array(\n+\n+      // int data\n+      \'int 0\' => 0,\n+      \'int 1\' => 1,\n+      \'int 12345\' => 12345,\n+      \'int -12345\' => -2345,\n+\n+      // float data\n+      \'float 10.5\' => 10.5,\n+      \'float -10.5\' => -10.5,\n+      \'float 12.3456789000e10\' => 12.3456789000e10,\n+      \'float -12.3456789000e10\' => -12.3456789000e10,\n+      \'float .5\' => .5,\n+\n+      // array data\n+      \'empty array\' => array(),\n+      \'int indexed array\' => $index_array,\n+      \'associative array\' => $assoc_array,\n+      \'nested arrays\' => array(\'foo\', $index_array, $assoc_array),\n+\n+      // null data\n+      \'uppercase NULL\' => NULL,\n+      \'lowercase null\' => null,\n+\n+      // boolean data\n+      \'lowercase true\' => true,\n+      \'lowercase false\' =>false,\n+      \'uppercase TRUE\' =>TRUE,\n+      \'uppercase FALSE\' =>FALSE,\n+\n+      // empty data\n+      \'empty string DQ\' => "",\n+      \'empty string SQ\' => \'\',\n+\n+      // object data\n+      \'instance of classWithToString\' => new classWithToString(),\n+      \'instance of classWithoutToString\' => new classWithoutToString(),\n+\n+      // undefined data\n+      \'undefined var\' => @$undefined_var,\n+\n+      // unset data\n+      \'unset var\' => @$unset_var,\n+      \n+      // resource variable\n+      \'resource\' => $fp      \n+);\n+\n+// loop through each element of the array for cipher\n+\n+foreach($inputs as $valueType =>$value) {\n+      echo "\\n--$valueType--\\n";\n+      var_dump( mcrypt_decrypt($value, $key, $data, $mode, $iv) );\n+};\n+\n+fclose($fp);\n+\n+?>\n+===DONE===\n+--EXPECTF--\n+*** Testing mcrypt_decrypt() : usage variation ***\n+\n+--int 0--\n+Error: 2 - mcrypt_decrypt(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--int 1--\n+Error: 2 - mcrypt_decrypt(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--int 12345--\n+Error: 2 - mcrypt_decrypt(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--int -12345--\n+Error: 2 - mcrypt_decrypt(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--float 10.5--\n+Error: 2 - mcrypt_decrypt(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--float -10.5--\n+Error: 2 - mcrypt_decrypt(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--float 12.3456789000e10--\n+Error: 2 - mcrypt_decrypt(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--float -12.3456789000e10--\n+Error: 2 - mcrypt_decrypt(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--float .5--\n+Error: 2 - mcrypt_decrypt(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--empty array--\n+Error: 2 - mcrypt_decrypt() expects parameter 1 to be string, array given, %s(%d)\n+NULL\n+\n+--int indexed array--\n+Error: 2 - mcrypt_decrypt() expects parameter 1 to be string, array given, %s(%d)\n+NULL\n+\n+--associative array--\n+Error: 2 - mcrypt_decrypt() expects parameter 1 to be string, array given, %s(%d)\n+NULL\n+\n+--nested arrays--\n+Error: 2 - mcrypt_decrypt() expects parameter 1 to be string, array given, %s(%d)\n+NULL\n+\n+--uppercase NULL--\n+Error: 2 - mcrypt_decrypt(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--lowercase null--\n+Error: 2 - mcrypt_decrypt(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--lowercase true--\n+Error: 2 - mcrypt_decrypt(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--lowercase false--\n+Error: 2 - mcrypt_decrypt(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--uppercase TRUE--\n+Error: 2 - mcrypt_decrypt(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--uppercase FALSE--\n+Error: 2 - mcrypt_decrypt(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--empty string DQ--\n+Error: 2 - mcrypt_decrypt(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--empty string SQ--\n+Error: 2 - mcrypt_decrypt(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--instance of classWithToString--\n+Error: 2 - mcrypt_decrypt(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--instance of classWithoutToString--\n+Error: 2 - mcrypt_decrypt() expects parameter 1 to be string, object given, %s(%d)\n+NULL\n+\n+--undefined var--\n+Error: 2 - mcrypt_decrypt(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--unset var--\n+Error: 2 - mcrypt_decrypt(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--resource--\n+Error: 2 - mcrypt_decrypt() expects parameter 1 to be string, resource given, %s(%d)\n+NULL\n+===DONE===\n+\ndiff --git a/test_phpt/ext/mcrypt/mcrypt_decrypt_variation2.phpt b/test_phpt/ext/mcrypt/mcrypt_decrypt_variation2.phpt\nnew file mode 100644\nindex 00000000..85adb9c9\n--- /dev/null\n+++ b/test_phpt/ext/mcrypt/mcrypt_decrypt_variation2.phpt\n@@ -0,0 +1,210 @@\n+--TEST--\n+Test mcrypt_decrypt() function : usage variation \n+--SKIPIF--\n+<?php \n+if (!extension_loaded("mcrypt")) {\n+\tprint "skip - mcrypt extension not loaded"; \n+}\t \n+?>\n+--FILE--\n+<?php\n+/* Prototype  : string mcrypt_decrypt(string cipher, string key, string data, string mode, string iv)\n+ * Description: OFB crypt/decrypt data using key key with cipher cipher starting with iv \n+ * Source code: ext/mcrypt/mcrypt.c\n+ * Alias to functions: \n+ */\n+\n+echo "*** Testing mcrypt_decrypt() : usage variation ***\\n";\n+\n+// Define error handler\n+function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {\n+\tif (error_reporting() != 0) {\n+\t\t// report non-silenced errors\n+\t\techo "Error: $err_no - $err_msg, $filename($linenum)\\n";\n+\t}\n+}\n+set_error_handler(\'test_error_handler\');\n+\n+// Initialise function arguments not being substituted (if any)\n+$cipher = MCRYPT_TRIPLEDES;\n+$data = b\'string_val\';\n+$mode = MCRYPT_MODE_ECB;\n+$iv = b\'01234567\';\n+\n+//get an unset variable\n+$unset_var = 10;\n+unset ($unset_var);\n+\n+// define some classes\n+class classWithToString\n+{\n+\tpublic function __toString() {\n+\t\treturn b"Class A object";\n+\t}\n+}\n+\n+class classWithoutToString\n+{\n+}\n+\n+// heredoc string\n+$heredoc = b<<<EOT\n+hello world\n+EOT;\n+\n+// get a resource variable\n+$fp = fopen(__FILE__, "r");\n+\n+// add arrays\n+$index_array = array (1, 2, 3);\n+$assoc_array = array (\'one\' => 1, \'two\' => 2);\n+\n+//array of values to iterate over\n+$inputs = array(\n+\n+      // int data\n+      \'int 0\' => 0,\n+      \'int 1\' => 1,\n+      \'int 12345\' => 12345,\n+      \'int -12345\' => -2345,\n+\n+      // float data\n+      \'float 10.5\' => 10.5,\n+      \'float -10.5\' => -10.5,\n+      \'float 12.3456789000e10\' => 12.3456789000e10,\n+      \'float -12.3456789000e10\' => -12.3456789000e10,\n+      \'float .5\' => .5,\n+\n+      // array data\n+      \'empty array\' => array(),\n+      \'int indexed array\' => $index_array,\n+      \'associative array\' => $assoc_array,\n+      \'nested arrays\' => array(\'foo\', $index_array, $assoc_array),\n+\n+      // null data\n+      \'uppercase NULL\' => NULL,\n+      \'lowercase null\' => null,\n+\n+      // boolean data\n+      \'lowercase true\' => true,\n+      \'lowercase false\' =>false,\n+      \'uppercase TRUE\' =>TRUE,\n+      \'uppercase FALSE\' =>FALSE,\n+\n+      // empty data\n+      \'empty string DQ\' => "",\n+      \'empty string SQ\' => \'\',\n+\n+      // object data\n+      \'instance of classWithToString\' => new classWithToString(),\n+      \'instance of classWithoutToString\' => new classWithoutToString(),\n+\n+      // undefined data\n+      \'undefined var\' => @$undefined_var,\n+\n+      // unset data\n+      \'unset var\' => @$unset_var,\n+      \n+      // resource variable\n+      \'resource\' => $fp      \n+);\n+\n+// loop through each element of the array for key\n+\n+foreach($inputs as $valueType =>$value) {\n+      echo "\\n--$valueType--\\n";\n+      var_dump( bin2hex(mcrypt_decrypt($cipher, $value, $data, $mode, $iv)));\n+};\n+\n+fclose($fp);\n+\n+?>\n+===DONE===\n+--EXPECTF--\n+*** Testing mcrypt_decrypt() : usage variation ***\n+\n+--int 0--\n+string(32) "43a1ae011df36064589d06bc922ecd97"\n+\n+--int 1--\n+string(32) "43a1ae011df36064589d06bc922ecd97"\n+\n+--int 12345--\n+string(32) "e5885552e16c44d4eb6164f477b40200"\n+\n+--int -12345--\n+string(32) "adf7873831a9035cda9f9dc3b7dc626b"\n+\n+--float 10.5--\n+string(32) "08b0b9fac9c227437b7b5d0147e6153b"\n+\n+--float -10.5--\n+string(32) "f470cc74d83471b42a3e28d4ec57799a"\n+\n+--float 12.3456789000e10--\n+string(32) "36c618c00523fadc372b871eaa9c7b16"\n+\n+--float -12.3456789000e10--\n+string(32) "a554a5bdb7a5ceb6ae6f20566ef02e49"\n+\n+--float .5--\n+string(32) "bcb840ff76d3788a7911ed36f088a910"\n+\n+--empty array--\n+Error: 2 - mcrypt_decrypt() expects parameter 2 to be string, array given, %s(%d)\n+string(0) ""\n+\n+--int indexed array--\n+Error: 2 - mcrypt_decrypt() expects parameter 2 to be string, array given, %s(%d)\n+string(0) ""\n+\n+--associative array--\n+Error: 2 - mcrypt_decrypt() expects parameter 2 to be string, array given, %s(%d)\n+string(0) ""\n+\n+--nested arrays--\n+Error: 2 - mcrypt_decrypt() expects parameter 2 to be string, array given, %s(%d)\n+string(0) ""\n+\n+--uppercase NULL--\n+string(32) "bfa2cb7240c8d2f6abeb34960c04f6d3"\n+\n+--lowercase null--\n+string(32) "bfa2cb7240c8d2f6abeb34960c04f6d3"\n+\n+--lowercase true--\n+string(32) "43a1ae011df36064589d06bc922ecd97"\n+\n+--lowercase false--\n+string(32) "bfa2cb7240c8d2f6abeb34960c04f6d3"\n+\n+--uppercase TRUE--\n+string(32) "43a1ae011df36064589d06bc922ecd97"\n+\n+--uppercase FALSE--\n+string(32) "bfa2cb7240c8d2f6abeb34960c04f6d3"\n+\n+--empty string DQ--\n+string(32) "bfa2cb7240c8d2f6abeb34960c04f6d3"\n+\n+--empty string SQ--\n+string(32) "bfa2cb7240c8d2f6abeb34960c04f6d3"\n+\n+--instance of classWithToString--\n+string(32) "478f9d080563835cc3136610802f1433"\n+\n+--instance of classWithoutToString--\n+Error: 2 - mcrypt_decrypt() expects parameter 2 to be string, object given, %s(%d)\n+string(0) ""\n+\n+--undefined var--\n+string(32) "bfa2cb7240c8d2f6abeb34960c04f6d3"\n+\n+--unset var--\n+string(32) "bfa2cb7240c8d2f6abeb34960c04f6d3"\n+\n+--resource--\n+Error: 2 - mcrypt_decrypt() expects parameter 2 to be string, resource given, %s(%d)\n+string(0) ""\n+===DONE===\n+\ndiff --git a/test_phpt/ext/mcrypt/mcrypt_decrypt_variation3.phpt b/test_phpt/ext/mcrypt/mcrypt_decrypt_variation3.phpt\nnew file mode 100644\nindex 00000000..50da2605\n--- /dev/null\n+++ b/test_phpt/ext/mcrypt/mcrypt_decrypt_variation3.phpt\n@@ -0,0 +1,210 @@\n+--TEST--\n+Test mcrypt_decrypt() function : usage variation \n+--SKIPIF--\n+<?php \n+if (!extension_loaded("mcrypt")) {\n+\tprint "skip - mcrypt extension not loaded"; \n+}\t \n+?>\n+--FILE--\n+<?php\n+/* Prototype  : string mcrypt_decrypt(string cipher, string key, string data, string mode, string iv)\n+ * Description: OFB crypt/decrypt data using key key with cipher cipher starting with iv \n+ * Source code: ext/mcrypt/mcrypt.c\n+ * Alias to functions: \n+ */\n+\n+echo "*** Testing mcrypt_decrypt() : usage variation ***\\n";\n+\n+// Define error handler\n+function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {\n+\tif (error_reporting() != 0) {\n+\t\t// report non-silenced errors\n+\t\techo "Error: $err_no - $err_msg, $filename($linenum)\\n";\n+\t}\n+}\n+set_error_handler(\'test_error_handler\');\n+\n+// Initialise function arguments not being substituted (if any)\n+$cipher = MCRYPT_TRIPLEDES;\n+$key = b\'string_val\';\n+$mode = MCRYPT_MODE_ECB;\n+$iv = b\'01234567\';\n+\n+//get an unset variable\n+$unset_var = 10;\n+unset ($unset_var);\n+\n+// define some classes\n+class classWithToString\n+{\n+\tpublic function __toString() {\n+\t\treturn b"Class A object";\n+\t}\n+}\n+\n+class classWithoutToString\n+{\n+}\n+\n+// heredoc string\n+$heredoc = b<<<EOT\n+hello world\n+EOT;\n+\n+// get a resource variable\n+$fp = fopen(__FILE__, "r");\n+\n+// add arrays\n+$index_array = array (1, 2, 3);\n+$assoc_array = array (\'one\' => 1, \'two\' => 2);\n+\n+//array of values to iterate over\n+$inputs = array(\n+\n+      // int data\n+      \'int 0\' => 0,\n+      \'int 1\' => 1,\n+      \'int 12345\' => 12345,\n+      \'int -12345\' => -2345,\n+\n+      // float data\n+      \'float 10.5\' => 10.5,\n+      \'float -10.5\' => -10.5,\n+      \'float 12.3456789000e10\' => 12.3456789000e10,\n+      \'float -12.3456789000e10\' => -12.3456789000e10,\n+      \'float .5\' => .5,\n+\n+      // array data\n+      \'empty array\' => array(),\n+      \'int indexed array\' => $index_array,\n+      \'associative array\' => $assoc_array,\n+      \'nested arrays\' => array(\'foo\', $index_array, $assoc_array),\n+\n+      // null data\n+      \'uppercase NULL\' => NULL,\n+      \'lowercase null\' => null,\n+\n+      // boolean data\n+      \'lowercase true\' => true,\n+      \'lowercase false\' =>false,\n+      \'uppercase TRUE\' =>TRUE,\n+      \'uppercase FALSE\' =>FALSE,\n+\n+      // empty data\n+      \'empty string DQ\' => "",\n+      \'empty string SQ\' => \'\',\n+\n+      // object data\n+      \'instance of classWithToString\' => new classWithToString(),\n+      \'instance of classWithoutToString\' => new classWithoutToString(),\n+\n+      // undefined data\n+      \'undefined var\' => @$undefined_var,\n+\n+      // unset data\n+      \'unset var\' => @$unset_var,\n+      \n+      // resource variable\n+      \'resource\' => $fp      \n+);\n+\n+// loop through each element of the array for data\n+\n+foreach($inputs as $valueType =>$value) {\n+      echo "\\n--$valueType--\\n";\n+      var_dump(bin2hex(mcrypt_decrypt($cipher, $key, $value, $mode, $iv)));\n+};\n+\n+fclose($fp);\n+\n+?>\n+===DONE===\n+--EXPECTF--\n+*** Testing mcrypt_decrypt() : usage variation ***\n+\n+--int 0--\n+string(16) "52833a00168e547f"\n+\n+--int 1--\n+string(16) "82011a0a93098a13"\n+\n+--int 12345--\n+string(16) "e8b71c21b6acc162"\n+\n+--int -12345--\n+string(16) "db3c458e975563a8"\n+\n+--float 10.5--\n+string(16) "6ee8764562f25913"\n+\n+--float -10.5--\n+string(16) "d63b39fd5f65678e"\n+\n+--float 12.3456789000e10--\n+string(32) "7712cc4828221be40672239d9c32e742"\n+\n+--float -12.3456789000e10--\n+string(32) "caa892cb5d28b53c2b75b1e0799427c3"\n+\n+--float .5--\n+string(16) "99880c86884385d9"\n+\n+--empty array--\n+Error: 2 - mcrypt_decrypt() expects parameter 3 to be string, array given, %s(%d)\n+string(0) ""\n+\n+--int indexed array--\n+Error: 2 - mcrypt_decrypt() expects parameter 3 to be string, array given, %s(%d)\n+string(0) ""\n+\n+--associative array--\n+Error: 2 - mcrypt_decrypt() expects parameter 3 to be string, array given, %s(%d)\n+string(0) ""\n+\n+--nested arrays--\n+Error: 2 - mcrypt_decrypt() expects parameter 3 to be string, array given, %s(%d)\n+string(0) ""\n+\n+--uppercase NULL--\n+string(16) "d27689f6fd9700f4"\n+\n+--lowercase null--\n+string(16) "d27689f6fd9700f4"\n+\n+--lowercase true--\n+string(16) "82011a0a93098a13"\n+\n+--lowercase false--\n+string(16) "d27689f6fd9700f4"\n+\n+--uppercase TRUE--\n+string(16) "82011a0a93098a13"\n+\n+--uppercase FALSE--\n+string(16) "d27689f6fd9700f4"\n+\n+--empty string DQ--\n+string(16) "d27689f6fd9700f4"\n+\n+--empty string SQ--\n+string(16) "d27689f6fd9700f4"\n+\n+--instance of classWithToString--\n+string(32) "46677e368bc07ef375bd580e0c4b2594"\n+\n+--instance of classWithoutToString--\n+Error: 2 - mcrypt_decrypt() expects parameter 3 to be string, object given, %s(%d)\n+string(0) ""\n+\n+--undefined var--\n+string(16) "d27689f6fd9700f4"\n+\n+--unset var--\n+string(16) "d27689f6fd9700f4"\n+\n+--resource--\n+Error: 2 - mcrypt_decrypt() expects parameter 3 to be string, resource given, %s(%d)\n+string(0) ""\n+===DONE===\n+\ndiff --git a/test_phpt/ext/mcrypt/mcrypt_decrypt_variation4.phpt b/test_phpt/ext/mcrypt/mcrypt_decrypt_variation4.phpt\nnew file mode 100644\nindex 00000000..12e44312\n--- /dev/null\n+++ b/test_phpt/ext/mcrypt/mcrypt_decrypt_variation4.phpt\n@@ -0,0 +1,235 @@\n+--TEST--\n+Test mcrypt_decrypt() function : usage variation \n+--SKIPIF--\n+<?php \n+if (!extension_loaded("mcrypt")) {\n+\tprint "skip - mcrypt extension not loaded"; \n+}\t \n+?>\n+--FILE--\n+<?php\n+/* Prototype  : string mcrypt_decrypt(string cipher, string key, string data, string mode, string iv)\n+ * Description: OFB crypt/decrypt data using key key with cipher cipher starting with iv \n+ * Source code: ext/mcrypt/mcrypt.c\n+ * Alias to functions: \n+ */\n+\n+echo "*** Testing mcrypt_decrypt() : usage variation ***\\n";\n+\n+// Define error handler\n+function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {\n+\tif (error_reporting() != 0) {\n+\t\t// report non-silenced errors\n+\t\techo "Error: $err_no - $err_msg, $filename($linenum)\\n";\n+\t}\n+}\n+set_error_handler(\'test_error_handler\');\n+\n+// Initialise function arguments not being substituted (if any)\n+$cipher = MCRYPT_TRIPLEDES;\n+$key = b\'string_val\';\n+$data = b\'string_val\';\n+$iv = b\'01234567\';\n+\n+//get an unset variable\n+$unset_var = 10;\n+unset ($unset_var);\n+\n+// define some classes\n+class classWithToString\n+{\n+\tpublic function __toString() {\n+\t\treturn "Class A object";\n+\t}\n+}\n+\n+class classWithoutToString\n+{\n+}\n+\n+// heredoc string\n+$heredoc = <<<EOT\n+hello world\n+EOT;\n+\n+// get a resource variable\n+$fp = fopen(__FILE__, "r");\n+\n+// add arrays\n+$index_array = array (1, 2, 3);\n+$assoc_array = array (\'one\' => 1, \'two\' => 2);\n+\n+//array of values to iterate over\n+$inputs = array(\n+\n+      // int data\n+      \'int 0\' => 0,\n+      \'int 1\' => 1,\n+      \'int 12345\' => 12345,\n+      \'int -12345\' => -2345,\n+\n+      // float data\n+      \'float 10.5\' => 10.5,\n+      \'float -10.5\' => -10.5,\n+      \'float 12.3456789000e10\' => 12.3456789000e10,\n+      \'float -12.3456789000e10\' => -12.3456789000e10,\n+      \'float .5\' => .5,\n+\n+      // array data\n+      \'empty array\' => array(),\n+      \'int indexed array\' => $index_array,\n+      \'associative array\' => $assoc_array,\n+      \'nested arrays\' => array(\'foo\', $index_array, $assoc_array),\n+\n+      // null data\n+      \'uppercase NULL\' => NULL,\n+      \'lowercase null\' => null,\n+\n+      // boolean data\n+      \'lowercase true\' => true,\n+      \'lowercase false\' =>false,\n+      \'uppercase TRUE\' =>TRUE,\n+      \'uppercase FALSE\' =>FALSE,\n+\n+      // empty data\n+      \'empty string DQ\' => "",\n+      \'empty string SQ\' => \'\',\n+\n+      // object data\n+      \'instance of classWithToString\' => new classWithToString(),\n+      \'instance of classWithoutToString\' => new classWithoutToString(),\n+\n+      // undefined data\n+      \'undefined var\' => @$undefined_var,\n+\n+      // unset data\n+      \'unset var\' => @$unset_var,\n+      \n+      // resource variable\n+      \'resource\' => $fp      \n+);\n+\n+// loop through each element of the array for mode\n+\n+foreach($inputs as $valueType =>$value) {\n+      echo "\\n--$valueType--\\n";\n+      var_dump( mcrypt_decrypt($cipher, $key, $data, $value, $iv) );\n+};\n+\n+fclose($fp);\n+\n+?>\n+===DONE===\n+--EXPECTF--\n+*** Testing mcrypt_decrypt() : usage variation ***\n+\n+--int 0--\n+Error: 2 - mcrypt_decrypt(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--int 1--\n+Error: 2 - mcrypt_decrypt(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--int 12345--\n+Error: 2 - mcrypt_decrypt(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--int -12345--\n+Error: 2 - mcrypt_decrypt(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--float 10.5--\n+Error: 2 - mcrypt_decrypt(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--float -10.5--\n+Error: 2 - mcrypt_decrypt(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--float 12.3456789000e10--\n+Error: 2 - mcrypt_decrypt(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--float -12.3456789000e10--\n+Error: 2 - mcrypt_decrypt(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--float .5--\n+Error: 2 - mcrypt_decrypt(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--empty array--\n+Error: 8 - Array to string conversion, %s(%d)\n+Error: 2 - mcrypt_decrypt(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--int indexed array--\n+Error: 8 - Array to string conversion, %s(%d)\n+Error: 2 - mcrypt_decrypt(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--associative array--\n+Error: 8 - Array to string conversion, %s(%d)\n+Error: 2 - mcrypt_decrypt(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--nested arrays--\n+Error: 8 - Array to string conversion, %s(%d)\n+Error: 2 - mcrypt_decrypt(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--uppercase NULL--\n+Error: 2 - mcrypt_decrypt(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--lowercase null--\n+Error: 2 - mcrypt_decrypt(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--lowercase true--\n+Error: 2 - mcrypt_decrypt(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--lowercase false--\n+Error: 2 - mcrypt_decrypt(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--uppercase TRUE--\n+Error: 2 - mcrypt_decrypt(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--uppercase FALSE--\n+Error: 2 - mcrypt_decrypt(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--empty string DQ--\n+Error: 2 - mcrypt_decrypt(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--empty string SQ--\n+Error: 2 - mcrypt_decrypt(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--instance of classWithToString--\n+Error: 2 - mcrypt_decrypt(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--instance of classWithoutToString--\n+Error: 4096 - Object of class classWithoutToString could not be converted to string, %s(%d)\n+Error: 8 - Object of class classWithoutToString to string conversion, %s(%d)\n+Error: 2 - mcrypt_decrypt(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--undefined var--\n+Error: 2 - mcrypt_decrypt(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--unset var--\n+Error: 2 - mcrypt_decrypt(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--resource--\n+Error: 2 - mcrypt_decrypt(): Module initialization failed, %s(%d)\n+bool(false)\n+===DONE===\ndiff --git a/test_phpt/ext/mcrypt/mcrypt_decrypt_variation5.phpt b/test_phpt/ext/mcrypt/mcrypt_decrypt_variation5.phpt\nnew file mode 100644\nindex 00000000..f1541bda\n--- /dev/null\n+++ b/test_phpt/ext/mcrypt/mcrypt_decrypt_variation5.phpt\n@@ -0,0 +1,230 @@\n+--TEST--\n+Test mcrypt_decrypt() function : usage variation \n+--SKIPIF--\n+<?php \n+if (!extension_loaded("mcrypt")) {\n+\tprint "skip - mcrypt extension not loaded"; \n+}\t \n+?>\n+--FILE--\n+<?php\n+/* Prototype  : string mcrypt_decrypt(string cipher, string key, string data, string mode, string iv)\n+ * Description: OFB crypt/decrypt data using key key with cipher cipher starting with iv \n+ * Source code: ext/mcrypt/mcrypt.c\n+ * Alias to functions: \n+ */\n+\n+echo "*** Testing mcrypt_decrypt() : usage variation ***\\n";\n+\n+// Define error handler\n+function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {\n+\tif (error_reporting() != 0) {\n+\t\t// report non-silenced errors\n+\t\techo "Error: $err_no - $err_msg, $filename($linenum)\\n";\n+\t}\n+}\n+set_error_handler(\'test_error_handler\');\n+\n+// Initialise function arguments not being substituted (if any)\n+$cipher = MCRYPT_TRIPLEDES;\n+$key = b\'string_val\';\n+$data = b\'string_val\';\n+$mode = MCRYPT_MODE_CBC;\n+\n+//get an unset variable\n+$unset_var = 10;\n+unset ($unset_var);\n+\n+// define some classes\n+class classWithToString\n+{\n+\tpublic function __toString() {\n+\t\treturn b"Class A object";\n+\t}\n+}\n+\n+class classWithoutToString\n+{\n+}\n+\n+// heredoc string\n+$heredoc = b<<<EOT\n+hello world\n+EOT;\n+\n+// get a resource variable\n+$fp = fopen(__FILE__, "r");\n+\n+// add arrays\n+$index_array = array (1, 2, 3);\n+$assoc_array = array (\'one\' => 1, \'two\' => 2);\n+\n+//array of values to iterate over\n+$inputs = array(\n+\n+      // int data\n+      \'int 0\' => 0,\n+      \'int 1\' => 1,\n+      \'int 12345\' => 12345,\n+      \'int -12345\' => -2345,\n+\n+      // float data\n+      \'float 10.5\' => 10.5,\n+      \'float -10.5\' => -10.5,\n+      \'float 12.3456789000e10\' => 12.3456789000e10,\n+      \'float -12.3456789000e10\' => -12.3456789000e10,\n+      \'float .5\' => .5,\n+\n+      // array data\n+      \'empty array\' => array(),\n+      \'int indexed array\' => $index_array,\n+      \'associative array\' => $assoc_array,\n+      \'nested arrays\' => array(\'foo\', $index_array, $assoc_array),\n+\n+      // null data\n+      \'uppercase NULL\' => NULL,\n+      \'lowercase null\' => null,\n+\n+      // boolean data\n+      \'lowercase true\' => true,\n+      \'lowercase false\' =>false,\n+      \'uppercase TRUE\' =>TRUE,\n+      \'uppercase FALSE\' =>FALSE,\n+\n+      // empty data\n+      \'empty string DQ\' => "",\n+      \'empty string SQ\' => \'\',\n+\n+      // object data\n+      \'instance of classWithToString\' => new classWithToString(),\n+      \'instance of classWithoutToString\' => new classWithoutToString(),\n+\n+      // undefined data\n+      \'undefined var\' => @$undefined_var,\n+\n+      // unset data\n+      \'unset var\' => @$unset_var,\n+      \n+      // resource variable\n+      \'resource\' => $fp      \n+);\n+\n+// loop through each element of the array for iv\n+\n+foreach($inputs as $valueType =>$value) {\n+      echo "\\n--$valueType--\\n";\n+      var_dump(bin2hex(mcrypt_decrypt($cipher, $key, $data, $mode, $value)));\n+};\n+\n+fclose($fp);\n+\n+?>\n+===DONE===\n+--EXPECTF--\n+*** Testing mcrypt_decrypt() : usage variation ***\n+\n+--int 0--\n+Error: 2 - mcrypt_decrypt(): The IV parameter must be as long as the blocksize, %s(%d)\n+string(32) "a80c6cef6b42c875e2372a0339dc22b0"\n+\n+--int 1--\n+Error: 2 - mcrypt_decrypt(): The IV parameter must be as long as the blocksize, %s(%d)\n+string(32) "a80c6cef6b42c875e2372a0339dc22b0"\n+\n+--int 12345--\n+Error: 2 - mcrypt_decrypt(): The IV parameter must be as long as the blocksize, %s(%d)\n+string(32) "a80c6cef6b42c875e2372a0339dc22b0"\n+\n+--int -12345--\n+Error: 2 - mcrypt_decrypt(): The IV parameter must be as long as the blocksize, %s(%d)\n+string(32) "a80c6cef6b42c875e2372a0339dc22b0"\n+\n+--float 10.5--\n+Error: 2 - mcrypt_decrypt(): The IV parameter must be as long as the blocksize, %s(%d)\n+string(32) "a80c6cef6b42c875e2372a0339dc22b0"\n+\n+--float -10.5--\n+Error: 2 - mcrypt_decrypt(): The IV parameter must be as long as the blocksize, %s(%d)\n+string(32) "a80c6cef6b42c875e2372a0339dc22b0"\n+\n+--float 12.3456789000e10--\n+Error: 2 - mcrypt_decrypt(): The IV parameter must be as long as the blocksize, %s(%d)\n+string(32) "a80c6cef6b42c875e2372a0339dc22b0"\n+\n+--float -12.3456789000e10--\n+Error: 2 - mcrypt_decrypt(): The IV parameter must be as long as the blocksize, %s(%d)\n+string(32) "a80c6cef6b42c875e2372a0339dc22b0"\n+\n+--float .5--\n+Error: 2 - mcrypt_decrypt(): The IV parameter must be as long as the blocksize, %s(%d)\n+string(32) "a80c6cef6b42c875e2372a0339dc22b0"\n+\n+--empty array--\n+Error: 2 - mcrypt_decrypt() expects parameter 5 to be string, array given, %s(%d)\n+string(0) ""\n+\n+--int indexed array--\n+Error: 2 - mcrypt_decrypt() expects parameter 5 to be string, array given, %s(%d)\n+string(0) ""\n+\n+--associative array--\n+Error: 2 - mcrypt_decrypt() expects parameter 5 to be string, array given, %s(%d)\n+string(0) ""\n+\n+--nested arrays--\n+Error: 2 - mcrypt_decrypt() expects parameter 5 to be string, array given, %s(%d)\n+string(0) ""\n+\n+--uppercase NULL--\n+Error: 2 - mcrypt_decrypt(): The IV parameter must be as long as the blocksize, %s(%d)\n+string(32) "a80c6cef6b42c875e2372a0339dc22b0"\n+\n+--lowercase null--\n+Error: 2 - mcrypt_decrypt(): The IV parameter must be as long as the blocksize, %s(%d)\n+string(32) "a80c6cef6b42c875e2372a0339dc22b0"\n+\n+--lowercase true--\n+Error: 2 - mcrypt_decrypt(): The IV parameter must be as long as the blocksize, %s(%d)\n+string(32) "a80c6cef6b42c875e2372a0339dc22b0"\n+\n+--lowercase false--\n+Error: 2 - mcrypt_decrypt(): The IV parameter must be as long as the blocksize, %s(%d)\n+string(32) "a80c6cef6b42c875e2372a0339dc22b0"\n+\n+--uppercase TRUE--\n+Error: 2 - mcrypt_decrypt(): The IV parameter must be as long as the blocksize, %s(%d)\n+string(32) "a80c6cef6b42c875e2372a0339dc22b0"\n+\n+--uppercase FALSE--\n+Error: 2 - mcrypt_decrypt(): The IV parameter must be as long as the blocksize, %s(%d)\n+string(32) "a80c6cef6b42c875e2372a0339dc22b0"\n+\n+--empty string DQ--\n+Error: 2 - mcrypt_decrypt(): The IV parameter must be as long as the blocksize, %s(%d)\n+string(32) "a80c6cef6b42c875e2372a0339dc22b0"\n+\n+--empty string SQ--\n+Error: 2 - mcrypt_decrypt(): The IV parameter must be as long as the blocksize, %s(%d)\n+string(32) "a80c6cef6b42c875e2372a0339dc22b0"\n+\n+--instance of classWithToString--\n+Error: 2 - mcrypt_decrypt(): The IV parameter must be as long as the blocksize, %s(%d)\n+string(32) "a80c6cef6b42c875e2372a0339dc22b0"\n+\n+--instance of classWithoutToString--\n+Error: 2 - mcrypt_decrypt() expects parameter 5 to be string, object given, %s(%d)\n+string(0) ""\n+\n+--undefined var--\n+Error: 2 - mcrypt_decrypt(): The IV parameter must be as long as the blocksize, %s(%d)\n+string(32) "a80c6cef6b42c875e2372a0339dc22b0"\n+\n+--unset var--\n+Error: 2 - mcrypt_decrypt(): The IV parameter must be as long as the blocksize, %s(%d)\n+string(32) "a80c6cef6b42c875e2372a0339dc22b0"\n+\n+--resource--\n+Error: 2 - mcrypt_decrypt() expects parameter 5 to be string, resource given, %s(%d)\n+string(0) ""\n+===DONE===\n+\ndiff --git a/test_phpt/ext/mcrypt/mcrypt_ecb.phpt b/test_phpt/ext/mcrypt/mcrypt_ecb.phpt\nnew file mode 100644\nindex 00000000..e75d9fa6\n--- /dev/null\n+++ b/test_phpt/ext/mcrypt/mcrypt_ecb.phpt\n@@ -0,0 +1,21 @@\n+--TEST--\n+mcrypt_ecb\n+--SKIPIF--\n+<?php if (!extension_loaded("mcrypt")) print "skip"; ?>\n+--FILE--\n+<?php\n+$key      = "FooBar";\n+$secret   = "PHP Testfest 2008";\n+$cipher   = MCRYPT_RIJNDAEL_128;\n+\n+$iv       = mcrypt_create_iv(mcrypt_get_iv_size($cipher, MCRYPT_MODE_ECB), MCRYPT_RAND);\n+$enc_data = mcrypt_ecb($cipher, $key, $secret, MCRYPT_ENCRYPT, $iv);\n+\n+// we have to trim as AES rounds the blocks and decrypt doesnt detect that\n+echo trim(mcrypt_ecb($cipher, $key, $enc_data, MCRYPT_DECRYPT, $iv)) . "\\n";\n+\n+// a warning must be issued if we don\'t use a IV on a AES cipher, that usually requires an IV\n+mcrypt_ecb($cipher, $key, $enc_data, MCRYPT_DECRYPT);\n+\n+--EXPECTF--\n+PHP Testfest 2008\ndiff --git a/test_phpt/ext/mcrypt/mcrypt_ecb_3des_decrypt.phpt b/test_phpt/ext/mcrypt/mcrypt_ecb_3des_decrypt.phpt\nnew file mode 100644\nindex 00000000..7a5cc27f\n--- /dev/null\n+++ b/test_phpt/ext/mcrypt/mcrypt_ecb_3des_decrypt.phpt\n@@ -0,0 +1,97 @@\n+--TEST--\n+Test mcrypt_cbc() function : basic functionality \n+--SKIPIF--\n+<?php \n+if (!extension_loaded("mcrypt")) {\n+\tprint "skip - mcrypt extension not loaded"; \n+}\t \n+?>\n+--FILE--\n+<?php\n+/* Prototype  : string mcrypt_ecb(int cipher, string key, string data, int mode, string iv)\n+ * Description: ECB crypt/decrypt data using key key with cipher cipher starting with iv \n+ * Source code: ext/mcrypt/mcrypt.c\n+ * Alias to functions: \n+ */\n+\n+echo "*** Testing mcrypt_ecb() : basic functionality ***\\n";\n+\n+\n+$cipher = MCRYPT_TRIPLEDES;\n+$data = b"This is the secret message which must be encrypted";\n+$mode = MCRYPT_DECRYPT;\n+\n+// tripledes uses keys upto 192 bits (24 bytes)\n+$keys = array(\n+   b\'12345678\', \n+   b\'12345678901234567890\', \n+   b\'123456789012345678901234\', \n+   b\'12345678901234567890123456\'\n+);\n+$data1 = array(\n+   \'0D4ArM3ejyhic9rnCcIW9A==\',\n+   \'q0wt1YeOjLpnKm5WsrzKEw==\',\n+   \'zwKEFeqHkhlj+7HZTRA/yA==\',\n+   \'zwKEFeqHkhlj+7HZTRA/yA==\'\n+);\n+// tripledes is a block cipher of 64 bits (8 bytes)\n+$ivs = array(\n+   b\'1234\', \n+   b\'12345678\', \n+   b\'123456789\'\n+);\n+$data2 = array(\n+   \'+G7nGcWIxigQcJD+2P14HA==\',\n+   \'+G7nGcWIxigQcJD+2P14HA==\',\n+   \'+G7nGcWIxigQcJD+2P14HA==\'\n+);\n+\n+$iv = b\'12345678\';\n+echo "\\n--- testing different key lengths\\n";\n+for ($i = 0; $i < sizeof($keys); $i++) {\n+   echo "\\nkey length=".strlen($keys[$i])."\\n";\n+   special_var_dump(mcrypt_ecb($cipher, $keys[$i], base64_decode($data1[$i]), $mode, $iv));\n+}\n+\n+$key = b\'1234567890123456\';  \n+echo "\\n--- testing different iv lengths\\n";\n+for ($i = 0; $i < sizeof($ivs); $i++) {\n+   echo "\\niv length=".strlen($ivs[$i])."\\n";\n+   special_var_dump(mcrypt_ecb($cipher, $key, base64_decode($data2[$i]), $mode, $ivs[$i]));\n+}\n+\n+function special_var_dump($str) {\n+   var_dump(bin2hex($str));\n+}  \n+?>\n+===DONE===\n+--EXPECTF--\n+*** Testing mcrypt_ecb() : basic functionality ***\n+\n+--- testing different key lengths\n+\n+key length=8\n+string(32) "736563726574206d6573736167650000"\n+\n+key length=20\n+string(32) "736563726574206d6573736167650000"\n+\n+key length=24\n+string(32) "736563726574206d6573736167650000"\n+\n+key length=26\n+\n+Warning: mcrypt_ecb(): Size of key is too large for this algorithm in %s on line %d\n+string(32) "736563726574206d6573736167650000"\n+\n+--- testing different iv lengths\n+\n+iv length=4\n+string(32) "736563726574206d6573736167650000"\n+\n+iv length=8\n+string(32) "736563726574206d6573736167650000"\n+\n+iv length=9\n+string(32) "736563726574206d6573736167650000"\n+===DONE===\n\\ No newline at end of file\ndiff --git a/test_phpt/ext/mcrypt/mcrypt_ecb_3des_encrypt.phpt b/test_phpt/ext/mcrypt/mcrypt_ecb_3des_encrypt.phpt\nnew file mode 100644\nindex 00000000..da26b4ba\n--- /dev/null\n+++ b/test_phpt/ext/mcrypt/mcrypt_ecb_3des_encrypt.phpt\n@@ -0,0 +1,82 @@\n+--TEST--\n+Test mcrypt_ecb() function : basic functionality \n+--SKIPIF--\n+<?php \n+if (!extension_loaded("mcrypt")) {\n+\tprint "skip - mcrypt extension not loaded"; \n+}\t \n+?>\n+--FILE--\n+<?php\n+/* Prototype  : string mcrypt_ecb(int cipher, string key, string data, int mode, string iv)\n+ * Description: ECB crypt/decrypt data using key key with cipher cipher starting with iv \n+ * Source code: ext/mcrypt/mcrypt.c\n+ * Alias to functions: \n+ */\n+\n+echo "*** Testing mcrypt_ecb() : basic functionality ***\\n";\n+\n+\n+$cipher = MCRYPT_TRIPLEDES;\n+$data = b"This is the secret message which must be encrypted";\n+$mode = MCRYPT_ENCRYPT;\n+\n+// tripledes uses keys upto 192 bits (24 bytes)\n+$keys = array(\n+   b\'12345678\', \n+   b\'12345678901234567890\', \n+   b\'123456789012345678901234\', \n+   b\'12345678901234567890123456\'\n+);\n+// tripledes is a block cipher of 64 bits (8 bytes)\n+$ivs = array(\n+   b\'1234\', \n+   b\'12345678\', \n+   b\'123456789\'\n+);\n+\n+$iv = b\'12345678\';\n+echo "\\n--- testing different key lengths\\n";\n+foreach ($keys as $key) {\n+   echo "\\nkey length=".strlen($key)."\\n";\n+   var_dump(bin2hex(mcrypt_ecb($cipher, $key, $data, $mode, $iv)));\n+}\n+\n+$key = b\'1234567890123456\';  \n+echo "\\n--- testing different iv lengths\\n";\n+foreach ($ivs as $iv) {\n+   echo "\\niv length=".strlen($iv)."\\n";\n+   var_dump(bin2hex(mcrypt_ecb($cipher, $key, $data, $mode, $iv)));\n+}\n+?>\n+===DONE===\n+--EXPECTF--\n+*** Testing mcrypt_ecb() : basic functionality ***\n+\n+--- testing different key lengths\n+\n+key length=8\n+string(112) "05c9c4cafb9937d950bdae60ee3abcb8d9f3e1f1fac8acaaa5b11d70b7ca02f3b76d447ab3dd85a4b5df5dedb4b4654595ccdf6da97fa93f"\n+\n+key length=20\n+string(112) "0fc7045c4fb4dbcf44baf9ed15ab40331a42ff0632318a16b12ed5873f02e7945e4f63f408d6849534cbb7419c22c8854aaa85e0e05a28e6"\n+\n+key length=24\n+string(112) "923eedcb20e18e3efa466a6ca1b842b34e6ac46aa3690ef739d0d68a26eb64e1a6ad42e7d18312ae8a57ab927e1dc892e5ff56c061864f27"\n+\n+key length=26\n+\n+Warning: mcrypt_ecb(): Size of key is too large for this algorithm in %s on line %d\n+string(112) "923eedcb20e18e3efa466a6ca1b842b34e6ac46aa3690ef739d0d68a26eb64e1a6ad42e7d18312ae8a57ab927e1dc892e5ff56c061864f27"\n+\n+--- testing different iv lengths\n+\n+iv length=4\n+string(112) "440a6f54601969b15e81df09cd381ef585fede5f3620587fd1a949c520aed9f6d10ebbabf2cea3e1f04c9251c2878c0ca37d51c80d490165"\n+\n+iv length=8\n+string(112) "440a6f54601969b15e81df09cd381ef585fede5f3620587fd1a949c520aed9f6d10ebbabf2cea3e1f04c9251c2878c0ca37d51c80d490165"\n+\n+iv length=9\n+string(112) "440a6f54601969b15e81df09cd381ef585fede5f3620587fd1a949c520aed9f6d10ebbabf2cea3e1f04c9251c2878c0ca37d51c80d490165"\n+===DONE===\ndiff --git a/test_phpt/ext/mcrypt/mcrypt_ecb_error.phpt b/test_phpt/ext/mcrypt/mcrypt_ecb_error.phpt\nnew file mode 100644\nindex 00000000..b33034af\n--- /dev/null\n+++ b/test_phpt/ext/mcrypt/mcrypt_ecb_error.phpt\n@@ -0,0 +1,52 @@\n+--TEST--\n+Test mcrypt_ecb() function : error conditions \n+--SKIPIF--\n+<?php \n+if (!extension_loaded("mcrypt")) {\n+\tprint "skip - mcrypt extension not loaded"; \n+}\t \n+?>\n+--FILE--\n+<?php\n+/* Prototype  : string mcrypt_ecb(int cipher, string key, string data, int mode, string iv)\n+ * Description: ECB crypt/decrypt data using key key with cipher cipher starting with iv \n+ * Source code: ext/mcrypt/mcrypt.c\n+ * Alias to functions: \n+ */\n+\n+echo "*** Testing mcrypt_ecb() : error conditions ***\\n";\n+\n+\n+//Test mcrypt_ecb with one more than the expected number of arguments\n+echo "\\n-- Testing mcrypt_ecb() function with more than expected no. of arguments --\\n";\n+$cipher = 10;\n+$key = \'string_val\';\n+$data = \'string_val\';\n+$mode = 10;\n+$iv = \'string_val\';\n+$extra_arg = 10;\n+var_dump( mcrypt_ecb($cipher, $key, $data, $mode, $iv, $extra_arg) );\n+\n+// Testing mcrypt_ecb with one less than the expected number of arguments\n+echo "\\n-- Testing mcrypt_ecb() function with less than expected no. of arguments --\\n";\n+$cipher = 10;\n+$key = \'string_val\';\n+$data = \'string_val\';\n+var_dump( mcrypt_ecb($cipher, $key, $data) );\n+\n+?>\n+===DONE===\n+--EXPECTF--\n+*** Testing mcrypt_ecb() : error conditions ***\n+\n+-- Testing mcrypt_ecb() function with more than expected no. of arguments --\n+\n+Warning: mcrypt_ecb() expects at most 5 parameters, 6 given in %s on line %d\n+NULL\n+\n+-- Testing mcrypt_ecb() function with less than expected no. of arguments --\n+\n+Warning: mcrypt_ecb() expects at least 4 parameters, 3 given in %s on line %d\n+NULL\n+===DONE===\n+\ndiff --git a/test_phpt/ext/mcrypt/mcrypt_ecb_variation1.phpt b/test_phpt/ext/mcrypt/mcrypt_ecb_variation1.phpt\nnew file mode 100644\nindex 00000000..282a0cce\n--- /dev/null\n+++ b/test_phpt/ext/mcrypt/mcrypt_ecb_variation1.phpt\n@@ -0,0 +1,230 @@\n+--TEST--\n+Test mcrypt_ecb() function : usage variation \n+--SKIPIF--\n+<?php \n+if (!extension_loaded("mcrypt")) {\n+\tprint "skip - mcrypt extension not loaded"; \n+}\t \n+?>\n+--FILE--\n+<?php\n+/* Prototype  : string mcrypt_ecb(string cipher, string key, string data, int mode, string iv)\n+ * Description: ECB crypt/decrypt data using key key with cipher cipher starting with iv \n+ * Source code: ext/mcrypt/mcrypt.c\n+ * Alias to functions: \n+ */\n+\n+echo "*** Testing mcrypt_ecb() : usage variation ***\\n";\n+\n+// Define error handler\n+function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {\n+\tif (error_reporting() != 0) {\n+\t\t// report non-silenced errors\n+\t\techo "Error: $err_no - $err_msg, $filename($linenum)\\n";\n+\t}\n+}\n+set_error_handler(\'test_error_handler\');\n+\n+// Initialise function arguments not being substituted (if any)\n+$key = b\'string_val\';\n+$data = b\'string_val\';\n+$mode = MCRYPT_ENCRYPT;\n+$iv = b\'string_val\';\n+\n+//get an unset variable\n+$unset_var = 10;\n+unset ($unset_var);\n+\n+// define some classes\n+class classWithToString\n+{\n+\tpublic function __toString() {\n+\t\treturn "Class A object";\n+\t}\n+}\n+\n+class classWithoutToString\n+{\n+}\n+\n+// heredoc string\n+$heredoc = <<<EOT\n+hello world\n+EOT;\n+\n+// get a resource variable\n+$fp = fopen(__FILE__, "r");\n+\n+// add arrays\n+$index_array = array (1, 2, 3);\n+$assoc_array = array (\'one\' => 1, \'two\' => 2);\n+\n+//array of values to iterate over\n+$inputs = array(\n+\n+      // int data\n+      \'int 0\' => 0,\n+      \'int 1\' => 1,\n+      \'int 12345\' => 12345,\n+      \'int -12345\' => -2345,\n+\n+      // float data\n+      \'float 10.5\' => 10.5,\n+      \'float -10.5\' => -10.5,\n+      \'float 12.3456789000e10\' => 12.3456789000e10,\n+      \'float -12.3456789000e10\' => -12.3456789000e10,\n+      \'float .5\' => .5,\n+\n+      // array data\n+      \'empty array\' => array(),\n+      \'int indexed array\' => $index_array,\n+      \'associative array\' => $assoc_array,\n+      \'nested arrays\' => array(\'foo\', $index_array, $assoc_array),\n+\n+      // null data\n+      \'uppercase NULL\' => NULL,\n+      \'lowercase null\' => null,\n+\n+      // boolean data\n+      \'lowercase true\' => true,\n+      \'lowercase false\' =>false,\n+      \'uppercase TRUE\' =>TRUE,\n+      \'uppercase FALSE\' =>FALSE,\n+\n+      // empty data\n+      \'empty string DQ\' => "",\n+      \'empty string SQ\' => \'\',\n+\n+      // object data\n+      \'instance of classWithToString\' => new classWithToString(),\n+      \'instance of classWithoutToString\' => new classWithoutToString(),\n+\n+      // undefined data\n+      \'undefined var\' => @$undefined_var,\n+\n+      // unset data\n+      \'unset var\' => @$unset_var,\n+      \n+      // resource variable\n+      \'resource\' => $fp      \n+);\n+\n+// loop through each element of the array for cipher\n+\n+foreach($inputs as $valueType =>$value) {\n+      echo "\\n--$valueType--\\n";\n+      var_dump( mcrypt_ecb($value, $key, $data, $mode, $iv) );\n+};\n+\n+fclose($fp);\n+\n+?>\n+===DONE===\n+--EXPECTF--\n+*** Testing mcrypt_ecb() : usage variation ***\n+\n+--int 0--\n+Error: 2 - mcrypt_ecb(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--int 1--\n+Error: 2 - mcrypt_ecb(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--int 12345--\n+Error: 2 - mcrypt_ecb(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--int -12345--\n+Error: 2 - mcrypt_ecb(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--float 10.5--\n+Error: 2 - mcrypt_ecb(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--float -10.5--\n+Error: 2 - mcrypt_ecb(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--float 12.3456789000e10--\n+Error: 2 - mcrypt_ecb(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--float -12.3456789000e10--\n+Error: 2 - mcrypt_ecb(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--float .5--\n+Error: 2 - mcrypt_ecb(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--empty array--\n+Error: 2 - mcrypt_ecb() expects parameter 1 to be string, array given, %s(%d)\n+NULL\n+\n+--int indexed array--\n+Error: 2 - mcrypt_ecb() expects parameter 1 to be string, array given, %s(%d)\n+NULL\n+\n+--associative array--\n+Error: 2 - mcrypt_ecb() expects parameter 1 to be string, array given, %s(%d)\n+NULL\n+\n+--nested arrays--\n+Error: 2 - mcrypt_ecb() expects parameter 1 to be string, array given, %s(%d)\n+NULL\n+\n+--uppercase NULL--\n+Error: 2 - mcrypt_ecb(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--lowercase null--\n+Error: 2 - mcrypt_ecb(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--lowercase true--\n+Error: 2 - mcrypt_ecb(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--lowercase false--\n+Error: 2 - mcrypt_ecb(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--uppercase TRUE--\n+Error: 2 - mcrypt_ecb(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--uppercase FALSE--\n+Error: 2 - mcrypt_ecb(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--empty string DQ--\n+Error: 2 - mcrypt_ecb(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--empty string SQ--\n+Error: 2 - mcrypt_ecb(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--instance of classWithToString--\n+Error: 2 - mcrypt_ecb(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--instance of classWithoutToString--\n+Error: 2 - mcrypt_ecb() expects parameter 1 to be string, object given, %s(%d)\n+NULL\n+\n+--undefined var--\n+Error: 2 - mcrypt_ecb(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--unset var--\n+Error: 2 - mcrypt_ecb(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--resource--\n+Error: 2 - mcrypt_ecb() expects parameter 1 to be string, resource given, %s(%d)\n+NULL\n+===DONE===\n+\ndiff --git a/test_phpt/ext/mcrypt/mcrypt_ecb_variation2.phpt b/test_phpt/ext/mcrypt/mcrypt_ecb_variation2.phpt\nnew file mode 100644\nindex 00000000..49e0a551\n--- /dev/null\n+++ b/test_phpt/ext/mcrypt/mcrypt_ecb_variation2.phpt\n@@ -0,0 +1,210 @@\n+--TEST--\n+Test mcrypt_ecb() function : usage variation \n+--SKIPIF--\n+<?php \n+if (!extension_loaded("mcrypt")) {\n+\tprint "skip - mcrypt extension not loaded"; \n+}\t \n+?>\n+--FILE--\n+<?php\n+/* Prototype  : string mcrypt_ecb(string cipher, string key, string data, int mode, string iv)\n+ * Description: ECB crypt/decrypt data using key key with cipher cipher starting with iv \n+ * Source code: ext/mcrypt/mcrypt.c\n+ * Alias to functions: \n+ */\n+\n+echo "*** Testing mcrypt_ecb() : usage variation ***\\n";\n+\n+// Define error handler\n+function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {\n+\tif (error_reporting() != 0) {\n+\t\t// report non-silenced errors\n+\t\techo "Error: $err_no - $err_msg, $filename($linenum)\\n";\n+\t}\n+}\n+set_error_handler(\'test_error_handler\');\n+\n+// Initialise function arguments not being substituted (if any)\n+$cipher = MCRYPT_TRIPLEDES;\n+$data = b\'string_val\';\n+$mode = MCRYPT_ENCRYPT;\n+$iv = b\'01234567\';\n+\n+//get an unset variable\n+$unset_var = 10;\n+unset ($unset_var);\n+\n+// define some classes\n+class classWithToString\n+{\n+\tpublic function __toString() {\n+\t\treturn b"Class A object";\n+\t}\n+}\n+\n+class classWithoutToString\n+{\n+}\n+\n+// heredoc string\n+$heredoc = b<<<EOT\n+hello world\n+EOT;\n+\n+// get a resource variable\n+$fp = fopen(__FILE__, "r");\n+\n+// add arrays\n+$index_array = array (1, 2, 3);\n+$assoc_array = array (\'one\' => 1, \'two\' => 2);\n+\n+//array of values to iterate over\n+$inputs = array(\n+\n+      // int data\n+      \'int 0\' => 0,\n+      \'int 1\' => 1,\n+      \'int 12345\' => 12345,\n+      \'int -12345\' => -2345,\n+\n+      // float data\n+      \'float 10.5\' => 10.5,\n+      \'float -10.5\' => -10.5,\n+      \'float 12.3456789000e10\' => 12.3456789000e10,\n+      \'float -12.3456789000e10\' => -12.3456789000e10,\n+      \'float .5\' => .5,\n+\n+      // array data\n+      \'empty array\' => array(),\n+      \'int indexed array\' => $index_array,\n+      \'associative array\' => $assoc_array,\n+      \'nested arrays\' => array(\'foo\', $index_array, $assoc_array),\n+\n+      // null data\n+      \'uppercase NULL\' => NULL,\n+      \'lowercase null\' => null,\n+\n+      // boolean data\n+      \'lowercase true\' => true,\n+      \'lowercase false\' =>false,\n+      \'uppercase TRUE\' =>TRUE,\n+      \'uppercase FALSE\' =>FALSE,\n+\n+      // empty data\n+      \'empty string DQ\' => "",\n+      \'empty string SQ\' => \'\',\n+\n+      // object data\n+      \'instance of classWithToString\' => new classWithToString(),\n+      \'instance of classWithoutToString\' => new classWithoutToString(),\n+\n+      // undefined data\n+      \'undefined var\' => @$undefined_var,\n+\n+      // unset data\n+      \'unset var\' => @$unset_var,\n+      \n+      // resource variable\n+      \'resource\' => $fp      \n+);\n+\n+// loop through each element of the array for key\n+\n+foreach($inputs as $valueType =>$value) {\n+      echo "\\n--$valueType--\\n";\n+      var_dump(bin2hex(mcrypt_ecb($cipher, $value, $data, $mode, $iv)));\n+};\n+\n+fclose($fp);\n+\n+?>\n+===DONE===\n+--EXPECTF--\n+*** Testing mcrypt_ecb() : usage variation ***\n+\n+--int 0--\n+string(32) "e469e6b066f9600e1eefd8f53365f96c"\n+\n+--int 1--\n+string(32) "e469e6b066f9600e1eefd8f53365f96c"\n+\n+--int 12345--\n+string(32) "d74e5f51d1199bcfa61f80168e913007"\n+\n+--int -12345--\n+string(32) "17fe485ed735abb34c1dd4455af7b79c"\n+\n+--float 10.5--\n+string(32) "cd735509aa4013a130e011686d66ae01"\n+\n+--float -10.5--\n+string(32) "a57d99d6d5813039abf50fc50d631e47"\n+\n+--float 12.3456789000e10--\n+string(32) "f17ede0bfdaa4408f545f7f4c8b040d2"\n+\n+--float -12.3456789000e10--\n+string(32) "326f64e3b9bd5a6beb0a9b52a09a5a48"\n+\n+--float .5--\n+string(32) "2aedf7661cd4d8c7593f44c58718e2b8"\n+\n+--empty array--\n+Error: 2 - mcrypt_ecb() expects parameter 2 to be string, array given, %s(%d)\n+string(0) ""\n+\n+--int indexed array--\n+Error: 2 - mcrypt_ecb() expects parameter 2 to be string, array given, %s(%d)\n+string(0) ""\n+\n+--associative array--\n+Error: 2 - mcrypt_ecb() expects parameter 2 to be string, array given, %s(%d)\n+string(0) ""\n+\n+--nested arrays--\n+Error: 2 - mcrypt_ecb() expects parameter 2 to be string, array given, %s(%d)\n+string(0) ""\n+\n+--uppercase NULL--\n+string(32) "bfa2cb7240c8d2f6abeb34960c04f6d3"\n+\n+--lowercase null--\n+string(32) "bfa2cb7240c8d2f6abeb34960c04f6d3"\n+\n+--lowercase true--\n+string(32) "e469e6b066f9600e1eefd8f53365f96c"\n+\n+--lowercase false--\n+string(32) "bfa2cb7240c8d2f6abeb34960c04f6d3"\n+\n+--uppercase TRUE--\n+string(32) "e469e6b066f9600e1eefd8f53365f96c"\n+\n+--uppercase FALSE--\n+string(32) "bfa2cb7240c8d2f6abeb34960c04f6d3"\n+\n+--empty string DQ--\n+string(32) "bfa2cb7240c8d2f6abeb34960c04f6d3"\n+\n+--empty string SQ--\n+string(32) "bfa2cb7240c8d2f6abeb34960c04f6d3"\n+\n+--instance of classWithToString--\n+string(32) "1fd3514d8ced44d04d9dc7511fce33ef"\n+\n+--instance of classWithoutToString--\n+Error: 2 - mcrypt_ecb() expects parameter 2 to be string, object given, %s(%d)\n+string(0) ""\n+\n+--undefined var--\n+string(32) "bfa2cb7240c8d2f6abeb34960c04f6d3"\n+\n+--unset var--\n+string(32) "bfa2cb7240c8d2f6abeb34960c04f6d3"\n+\n+--resource--\n+Error: 2 - mcrypt_ecb() expects parameter 2 to be string, resource given, %s(%d)\n+string(0) ""\n+===DONE===\n+\ndiff --git a/test_phpt/ext/mcrypt/mcrypt_ecb_variation3.phpt b/test_phpt/ext/mcrypt/mcrypt_ecb_variation3.phpt\nnew file mode 100644\nindex 00000000..cedda493\n--- /dev/null\n+++ b/test_phpt/ext/mcrypt/mcrypt_ecb_variation3.phpt\n@@ -0,0 +1,210 @@\n+--TEST--\n+Test mcrypt_ecb() function : usage variation \n+--SKIPIF--\n+<?php \n+if (!extension_loaded("mcrypt")) {\n+\tprint "skip - mcrypt extension not loaded"; \n+}\t \n+?>\n+--FILE--\n+<?php\n+/* Prototype  : string mcrypt_ecb(string cipher, string key, string data, int mode, string iv)\n+ * Description: ECB crypt/decrypt data using key key with cipher cipher starting with iv \n+ * Source code: ext/mcrypt/mcrypt.c\n+ * Alias to functions: \n+ */\n+\n+echo "*** Testing mcrypt_ecb() : usage variation ***\\n";\n+\n+// Define error handler\n+function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {\n+\tif (error_reporting() != 0) {\n+\t\t// report non-silenced errors\n+\t\techo "Error: $err_no - $err_msg, $filename($linenum)\\n";\n+\t}\n+}\n+set_error_handler(\'test_error_handler\');\n+\n+// Initialise function arguments not being substituted (if any)\n+$cipher = MCRYPT_TRIPLEDES;\n+$key = b\'string_val\';\n+$mode = MCRYPT_ENCRYPT;\n+$iv = b\'01234567\';\n+\n+//get an unset variable\n+$unset_var = 10;\n+unset ($unset_var);\n+\n+// define some classes\n+class classWithToString\n+{\n+\tpublic function __toString() {\n+\t\treturn b"Class A object";\n+\t}\n+}\n+\n+class classWithoutToString\n+{\n+}\n+\n+// heredoc string\n+$heredoc = b<<<EOT\n+hello world\n+EOT;\n+\n+// get a resource variable\n+$fp = fopen(__FILE__, "r");\n+\n+// add arrays\n+$index_array = array (1, 2, 3);\n+$assoc_array = array (\'one\' => 1, \'two\' => 2);\n+\n+//array of values to iterate over\n+$inputs = array(\n+\n+      // int data\n+      \'int 0\' => 0,\n+      \'int 1\' => 1,\n+      \'int 12345\' => 12345,\n+      \'int -12345\' => -2345,\n+\n+      // float data\n+      \'float 10.5\' => 10.5,\n+      \'float -10.5\' => -10.5,\n+      \'float 12.3456789000e10\' => 12.3456789000e10,\n+      \'float -12.3456789000e10\' => -12.3456789000e10,\n+      \'float .5\' => .5,\n+\n+      // array data\n+      \'empty array\' => array(),\n+      \'int indexed array\' => $index_array,\n+      \'associative array\' => $assoc_array,\n+      \'nested arrays\' => array(\'foo\', $index_array, $assoc_array),\n+\n+      // null data\n+      \'uppercase NULL\' => NULL,\n+      \'lowercase null\' => null,\n+\n+      // boolean data\n+      \'lowercase true\' => true,\n+      \'lowercase false\' =>false,\n+      \'uppercase TRUE\' =>TRUE,\n+      \'uppercase FALSE\' =>FALSE,\n+\n+      // empty data\n+      \'empty string DQ\' => "",\n+      \'empty string SQ\' => \'\',\n+\n+      // object data\n+      \'instance of classWithToString\' => new classWithToString(),\n+      \'instance of classWithoutToString\' => new classWithoutToString(),\n+\n+      // undefined data\n+      \'undefined var\' => @$undefined_var,\n+\n+      // unset data\n+      \'unset var\' => @$unset_var,\n+      \n+      // resource variable\n+      \'resource\' => $fp      \n+);\n+\n+// loop through each element of the array for data\n+\n+foreach($inputs as $valueType =>$value) {\n+      echo "\\n--$valueType--\\n";\n+      var_dump(bin2hex(mcrypt_ecb($cipher, $key, $value, $mode, $iv)));\n+};\n+\n+fclose($fp);\n+\n+?>\n+===DONE===\n+--EXPECTF--\n+*** Testing mcrypt_ecb() : usage variation ***\n+\n+--int 0--\n+string(16) "51dc9cd9179b718b"\n+\n+--int 1--\n+string(16) "619c335f8c4f9cbf"\n+\n+--int 12345--\n+string(16) "b1258d67ab73de00"\n+\n+--int -12345--\n+string(16) "8eecf134443bd6b9"\n+\n+--float 10.5--\n+string(16) "34b5750a793baff5"\n+\n+--float -10.5--\n+string(16) "7a605f2aacc8a11d"\n+\n+--float 12.3456789000e10--\n+string(32) "74a0d7026ae586f476d4b17808851e86"\n+\n+--float -12.3456789000e10--\n+string(32) "bfb155997017986c01090afebd62c7ca"\n+\n+--float .5--\n+string(16) "cc60ac201164b6c7"\n+\n+--empty array--\n+Error: 2 - mcrypt_ecb() expects parameter 3 to be string, array given, %s(%d)\n+string(0) ""\n+\n+--int indexed array--\n+Error: 2 - mcrypt_ecb() expects parameter 3 to be string, array given, %s(%d)\n+string(0) ""\n+\n+--associative array--\n+Error: 2 - mcrypt_ecb() expects parameter 3 to be string, array given, %s(%d)\n+string(0) ""\n+\n+--nested arrays--\n+Error: 2 - mcrypt_ecb() expects parameter 3 to be string, array given, %s(%d)\n+string(0) ""\n+\n+--uppercase NULL--\n+string(16) "6ece228c41457539"\n+\n+--lowercase null--\n+string(16) "6ece228c41457539"\n+\n+--lowercase true--\n+string(16) "619c335f8c4f9cbf"\n+\n+--lowercase false--\n+string(16) "6ece228c41457539"\n+\n+--uppercase TRUE--\n+string(16) "619c335f8c4f9cbf"\n+\n+--uppercase FALSE--\n+string(16) "6ece228c41457539"\n+\n+--empty string DQ--\n+string(16) "6ece228c41457539"\n+\n+--empty string SQ--\n+string(16) "6ece228c41457539"\n+\n+--instance of classWithToString--\n+string(32) "749c3b4d16731d98370128754b7c930f"\n+\n+--instance of classWithoutToString--\n+Error: 2 - mcrypt_ecb() expects parameter 3 to be string, object given, %s(%d)\n+string(0) ""\n+\n+--undefined var--\n+string(16) "6ece228c41457539"\n+\n+--unset var--\n+string(16) "6ece228c41457539"\n+\n+--resource--\n+Error: 2 - mcrypt_ecb() expects parameter 3 to be string, resource given, %s(%d)\n+string(0) ""\n+===DONE===\n+\ndiff --git a/test_phpt/ext/mcrypt/mcrypt_ecb_variation4.phpt b/test_phpt/ext/mcrypt/mcrypt_ecb_variation4.phpt\nnew file mode 100644\nindex 00000000..599b4fbe\n--- /dev/null\n+++ b/test_phpt/ext/mcrypt/mcrypt_ecb_variation4.phpt\n@@ -0,0 +1,205 @@\n+--TEST--\n+Test mcrypt_ecb() function : usage variation \n+--SKIPIF--\n+<?php \n+if (!extension_loaded("mcrypt")) {\n+\tprint "skip - mcrypt extension not loaded"; \n+}\t \n+?>\n+--FILE--\n+<?php\n+/* Prototype  : string mcrypt_ecb(string cipher, string key, string data, int mode, string iv)\n+ * Description: ECB crypt/decrypt data using key key with cipher cipher starting with iv \n+ * Source code: ext/mcrypt/mcrypt.c\n+ * Alias to functions: \n+ */\n+\n+echo "*** Testing mcrypt_ecb() : usage variation ***\\n";\n+\n+// Define error handler\n+function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {\n+\tif (error_reporting() != 0) {\n+\t\t// report non-silenced errors\n+\t\techo "Error: $err_no - $err_msg, $filename($linenum)\\n";\n+\t}\n+}\n+set_error_handler(\'test_error_handler\');\n+\n+// Initialise function arguments not being substituted (if any)\n+$cipher = MCRYPT_TRIPLEDES;\n+$key = b\'string_val\';\n+$data = b\'string_val\';\n+$iv = b\'01234567\';\n+\n+//get an unset variable\n+$unset_var = 10;\n+unset ($unset_var);\n+\n+// define some classes\n+class classWithToString\n+{\n+\tpublic function __toString() {\n+\t\treturn "Class A object";\n+\t}\n+}\n+\n+class classWithoutToString\n+{\n+}\n+\n+// heredoc string\n+$heredoc = <<<EOT\n+hello world\n+EOT;\n+\n+// get a resource variable\n+$fp = fopen(__FILE__, "r");\n+\n+// add arrays\n+$index_array = array (1, 2, 3);\n+$assoc_array = array (\'one\' => 1, \'two\' => 2);\n+\n+//array of values to iterate over\n+$inputs = array(\n+\n+      // float data\n+      \'float 10.5\' => 10.5,\n+      \'float -10.5\' => -10.5,\n+      \'float 12.3456789000e10\' => 12.3456789000e10,\n+      \'float -12.3456789000e10\' => -12.3456789000e10,\n+      \'float .5\' => .5,\n+\n+      // array data\n+      \'empty array\' => array(),\n+      \'int indexed array\' => $index_array,\n+      \'associative array\' => $assoc_array,\n+      \'nested arrays\' => array(\'foo\', $index_array, $assoc_array),\n+\n+      // null data\n+      \'uppercase NULL\' => NULL,\n+      \'lowercase null\' => null,\n+\n+      // boolean data\n+      \'lowercase true\' => true,\n+      \'lowercase false\' =>false,\n+      \'uppercase TRUE\' =>TRUE,\n+      \'uppercase FALSE\' =>FALSE,\n+\n+      // empty data\n+      \'empty string DQ\' => "",\n+      \'empty string SQ\' => \'\',\n+\n+      // string data\n+      \'string DQ\' => "string",\n+      \'string SQ\' => \'string\',\n+      \'mixed case string\' => "sTrInG",\n+      \'heredoc\' => $heredoc,\n+\n+      // object data\n+      \'instance of classWithToString\' => new classWithToString(),\n+      \'instance of classWithoutToString\' => new classWithoutToString(),\n+\n+      // undefined data\n+      \'undefined var\' => @$undefined_var,\n+\n+      // unset data\n+      \'unset var\' => @$unset_var,\n+      \n+      // resource variable\n+      \'resource\' => $fp      \n+);\n+\n+// loop through each element of the array for mode\n+\n+foreach($inputs as $valueType =>$value) {\n+      echo "\\n--$valueType--\\n";\n+      var_dump(bin2hex(mcrypt_ecb($cipher, $key, $data, $value, $iv)));\n+};\n+\n+fclose($fp);\n+\n+?>\n+===DONE===\n+--EXPECTF--\n+*** Testing mcrypt_ecb() : usage variation ***\n+\n+--float 10.5--\n+string(32) "a80c6cef6b42c8759143586a57bb7dc6"\n+\n+--float -10.5--\n+string(32) "a80c6cef6b42c8759143586a57bb7dc6"\n+\n+--float 12.3456789000e10--\n+string(32) "a80c6cef6b42c8759143586a57bb7dc6"\n+\n+--float -12.3456789000e10--\n+string(32) "a80c6cef6b42c8759143586a57bb7dc6"\n+\n+--float .5--\n+string(32) "6438db90653c4d300909aa02fd6163c2"\n+\n+--empty array--\n+string(32) "6438db90653c4d300909aa02fd6163c2"\n+\n+--int indexed array--\n+string(32) "a80c6cef6b42c8759143586a57bb7dc6"\n+\n+--associative array--\n+string(32) "a80c6cef6b42c8759143586a57bb7dc6"\n+\n+--nested arrays--\n+string(32) "a80c6cef6b42c8759143586a57bb7dc6"\n+\n+--uppercase NULL--\n+string(32) "6438db90653c4d300909aa02fd6163c2"\n+\n+--lowercase null--\n+string(32) "6438db90653c4d300909aa02fd6163c2"\n+\n+--lowercase true--\n+string(32) "a80c6cef6b42c8759143586a57bb7dc6"\n+\n+--lowercase false--\n+string(32) "6438db90653c4d300909aa02fd6163c2"\n+\n+--uppercase TRUE--\n+string(32) "a80c6cef6b42c8759143586a57bb7dc6"\n+\n+--uppercase FALSE--\n+string(32) "6438db90653c4d300909aa02fd6163c2"\n+\n+--empty string DQ--\n+string(32) "6438db90653c4d300909aa02fd6163c2"\n+\n+--empty string SQ--\n+string(32) "6438db90653c4d300909aa02fd6163c2"\n+\n+--string DQ--\n+string(32) "6438db90653c4d300909aa02fd6163c2"\n+\n+--string SQ--\n+string(32) "6438db90653c4d300909aa02fd6163c2"\n+\n+--mixed case string--\n+string(32) "6438db90653c4d300909aa02fd6163c2"\n+\n+--heredoc--\n+string(32) "6438db90653c4d300909aa02fd6163c2"\n+\n+--instance of classWithToString--\n+Error: 8 - Object of class classWithToString could not be converted to int, %s(%d)\n+string(32) "a80c6cef6b42c8759143586a57bb7dc6"\n+\n+--instance of classWithoutToString--\n+Error: 8 - Object of class classWithoutToString could not be converted to int, %s(%d)\n+string(32) "a80c6cef6b42c8759143586a57bb7dc6"\n+\n+--undefined var--\n+string(32) "6438db90653c4d300909aa02fd6163c2"\n+\n+--unset var--\n+string(32) "6438db90653c4d300909aa02fd6163c2"\n+\n+--resource--\n+string(%d) %s\n+===DONE===\ndiff --git a/test_phpt/ext/mcrypt/mcrypt_ecb_variation5.phpt b/test_phpt/ext/mcrypt/mcrypt_ecb_variation5.phpt\nnew file mode 100644\nindex 00000000..f64744fc\n--- /dev/null\n+++ b/test_phpt/ext/mcrypt/mcrypt_ecb_variation5.phpt\n@@ -0,0 +1,210 @@\n+--TEST--\n+Test mcrypt_ecb() function : usage variation \n+--SKIPIF--\n+<?php \n+if (!extension_loaded("mcrypt")) {\n+\tprint "skip - mcrypt extension not loaded"; \n+}\t \n+?>\n+--FILE--\n+<?php\n+/* Prototype  : string mcrypt_ecb(string cipher, string key, string data, int mode, string iv)\n+ * Description: ECB crypt/decrypt data using key key with cipher cipher starting with iv \n+ * Source code: ext/mcrypt/mcrypt.c\n+ * Alias to functions: \n+ */\n+\n+echo "*** Testing mcrypt_ecb() : usage variation ***\\n";\n+\n+// Define error handler\n+function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {\n+\tif (error_reporting() != 0) {\n+\t\t// report non-silenced errors\n+\t\techo "Error: $err_no - $err_msg, $filename($linenum)\\n";\n+\t}\n+}\n+set_error_handler(\'test_error_handler\');\n+\n+// Initialise function arguments not being substituted (if any)\n+$cipher = MCRYPT_TRIPLEDES;\n+$key = b\'string_val\';\n+$data = b\'string_val\';\n+$mode = MCRYPT_ENCRYPT;\n+\n+//get an unset variable\n+$unset_var = 10;\n+unset ($unset_var);\n+\n+// define some classes\n+class classWithToString\n+{\n+\tpublic function __toString() {\n+\t\treturn b"Class A object";\n+\t}\n+}\n+\n+class classWithoutToString\n+{\n+}\n+\n+// heredoc string\n+$heredoc = b<<<EOT\n+hello world\n+EOT;\n+\n+// get a resource variable\n+$fp = fopen(__FILE__, "r");\n+\n+// add arrays\n+$index_array = array (1, 2, 3);\n+$assoc_array = array (\'one\' => 1, \'two\' => 2);\n+\n+//array of values to iterate over\n+$inputs = array(\n+\n+      // int data\n+      \'int 0\' => 0,\n+      \'int 1\' => 1,\n+      \'int 12345\' => 12345,\n+      \'int -12345\' => -2345,\n+\n+      // float data\n+      \'float 10.5\' => 10.5,\n+      \'float -10.5\' => -10.5,\n+      \'float 12.3456789000e10\' => 12.3456789000e10,\n+      \'float -12.3456789000e10\' => -12.3456789000e10,\n+      \'float .5\' => .5,\n+\n+      // array data\n+      \'empty array\' => array(),\n+      \'int indexed array\' => $index_array,\n+      \'associative array\' => $assoc_array,\n+      \'nested arrays\' => array(\'foo\', $index_array, $assoc_array),\n+\n+      // null data\n+      \'uppercase NULL\' => NULL,\n+      \'lowercase null\' => null,\n+\n+      // boolean data\n+      \'lowercase true\' => true,\n+      \'lowercase false\' =>false,\n+      \'uppercase TRUE\' =>TRUE,\n+      \'uppercase FALSE\' =>FALSE,\n+\n+      // empty data\n+      \'empty string DQ\' => "",\n+      \'empty string SQ\' => \'\',\n+\n+      // object data\n+      \'instance of classWithToString\' => new classWithToString(),\n+      \'instance of classWithoutToString\' => new classWithoutToString(),\n+\n+      // undefined data\n+      \'undefined var\' => @$undefined_var,\n+\n+      // unset data\n+      \'unset var\' => @$unset_var,\n+      \n+      // resource variable\n+      \'resource\' => $fp      \n+);\n+\n+// loop through each element of the array for iv\n+\n+foreach($inputs as $valueType =>$value) {\n+      echo "\\n--$valueType--\\n";\n+      var_dump(bin2hex( mcrypt_ecb($cipher, $key, $data, $mode, $value)));\n+};\n+\n+fclose($fp);\n+\n+?>\n+===DONE===\n+--EXPECTF--\n+*** Testing mcrypt_ecb() : usage variation ***\n+\n+--int 0--\n+string(32) "6438db90653c4d300909aa02fd6163c2"\n+\n+--int 1--\n+string(32) "6438db90653c4d300909aa02fd6163c2"\n+\n+--int 12345--\n+string(32) "6438db90653c4d300909aa02fd6163c2"\n+\n+--int -12345--\n+string(32) "6438db90653c4d300909aa02fd6163c2"\n+\n+--float 10.5--\n+string(32) "6438db90653c4d300909aa02fd6163c2"\n+\n+--float -10.5--\n+string(32) "6438db90653c4d300909aa02fd6163c2"\n+\n+--float 12.3456789000e10--\n+string(32) "6438db90653c4d300909aa02fd6163c2"\n+\n+--float -12.3456789000e10--\n+string(32) "6438db90653c4d300909aa02fd6163c2"\n+\n+--float .5--\n+string(32) "6438db90653c4d300909aa02fd6163c2"\n+\n+--empty array--\n+Error: 2 - mcrypt_ecb() expects parameter 5 to be string, array given, %s(%d)\n+string(0) ""\n+\n+--int indexed array--\n+Error: 2 - mcrypt_ecb() expects parameter 5 to be string, array given, %s(%d)\n+string(0) ""\n+\n+--associative array--\n+Error: 2 - mcrypt_ecb() expects parameter 5 to be string, array given, %s(%d)\n+string(0) ""\n+\n+--nested arrays--\n+Error: 2 - mcrypt_ecb() expects parameter 5 to be string, array given, %s(%d)\n+string(0) ""\n+\n+--uppercase NULL--\n+string(32) "6438db90653c4d300909aa02fd6163c2"\n+\n+--lowercase null--\n+string(32) "6438db90653c4d300909aa02fd6163c2"\n+\n+--lowercase true--\n+string(32) "6438db90653c4d300909aa02fd6163c2"\n+\n+--lowercase false--\n+string(32) "6438db90653c4d300909aa02fd6163c2"\n+\n+--uppercase TRUE--\n+string(32) "6438db90653c4d300909aa02fd6163c2"\n+\n+--uppercase FALSE--\n+string(32) "6438db90653c4d300909aa02fd6163c2"\n+\n+--empty string DQ--\n+string(32) "6438db90653c4d300909aa02fd6163c2"\n+\n+--empty string SQ--\n+string(32) "6438db90653c4d300909aa02fd6163c2"\n+\n+--instance of classWithToString--\n+string(32) "6438db90653c4d300909aa02fd6163c2"\n+\n+--instance of classWithoutToString--\n+Error: 2 - mcrypt_ecb() expects parameter 5 to be string, object given, %s(%d)\n+string(0) ""\n+\n+--undefined var--\n+string(32) "6438db90653c4d300909aa02fd6163c2"\n+\n+--unset var--\n+string(32) "6438db90653c4d300909aa02fd6163c2"\n+\n+--resource--\n+Error: 2 - mcrypt_ecb() expects parameter 5 to be string, resource given, %s(%d)\n+string(0) ""\n+===DONE===\n+\ndiff --git a/test_phpt/ext/mcrypt/mcrypt_enc_get_algorithms_name.phpt b/test_phpt/ext/mcrypt/mcrypt_enc_get_algorithms_name.phpt\nnew file mode 100644\nindex 00000000..5b0bb01b\n--- /dev/null\n+++ b/test_phpt/ext/mcrypt/mcrypt_enc_get_algorithms_name.phpt\n@@ -0,0 +1,22 @@\n+--TEST--\n+mcrypt_enc_get_algorithms_name\n+--SKIPIF--\n+<?php if (!extension_loaded("mcrypt")) print "skip"; ?>\n+--FILE--\n+<?php\n+$td  = mcrypt_module_open(\'rijndael-128\', \'\', MCRYPT_MODE_ECB, \'\');\n+echo mcrypt_enc_get_algorithms_name($td) . "\\n";\n+$td  = mcrypt_module_open(MCRYPT_RIJNDAEL_128, \'\', MCRYPT_MODE_ECB, \'\');\n+echo mcrypt_enc_get_algorithms_name($td) . "\\n";\n+$td  = mcrypt_module_open(MCRYPT_RC2, \'\', MCRYPT_MODE_CBC, \'\');\n+echo mcrypt_enc_get_algorithms_name($td) . "\\n";\n+$td  = mcrypt_module_open(MCRYPT_BLOWFISH, \'\', MCRYPT_MODE_CBC, \'\');\n+echo mcrypt_enc_get_algorithms_name($td) . "\\n";\n+$td  = mcrypt_module_open(\'des\', \'\', \'ecb\', \'\');\n+echo mcrypt_enc_get_algorithms_name($td) . "\\n";\n+--EXPECT--\n+Rijndael-128\n+Rijndael-128\n+RC2\n+Blowfish\n+DES\n\\ No newline at end of file\ndiff --git a/test_phpt/ext/mcrypt/mcrypt_enc_get_block_size.phpt b/test_phpt/ext/mcrypt/mcrypt_enc_get_block_size.phpt\nnew file mode 100644\nindex 00000000..06f5adda\n--- /dev/null\n+++ b/test_phpt/ext/mcrypt/mcrypt_enc_get_block_size.phpt\n@@ -0,0 +1,16 @@\n+--TEST--\n+mcrypt_enc_get_block_size\n+--SKIPIF--\n+<?php if (!extension_loaded("mcrypt")) print "skip"; ?>\n+--FILE--\n+<?php\n+$td = mcrypt_module_open(MCRYPT_RIJNDAEL_256, \'\', MCRYPT_MODE_CBC, \'\');\n+var_dump(mcrypt_enc_get_block_size($td));\n+$td = mcrypt_module_open(MCRYPT_3DES, \'\', MCRYPT_MODE_CBC, \'\');\n+var_dump(mcrypt_enc_get_block_size($td));\n+$td = mcrypt_module_open(MCRYPT_WAKE, \'\', MCRYPT_MODE_STREAM, \'\');\n+var_dump(mcrypt_enc_get_block_size($td));\n+--EXPECT--\n+int(32)\n+int(8)\n+int(1)\ndiff --git a/test_phpt/ext/mcrypt/mcrypt_enc_get_iv_size.phpt b/test_phpt/ext/mcrypt/mcrypt_enc_get_iv_size.phpt\nnew file mode 100644\nindex 00000000..b4f9d6e4\n--- /dev/null\n+++ b/test_phpt/ext/mcrypt/mcrypt_enc_get_iv_size.phpt\n@@ -0,0 +1,16 @@\n+--TEST--\n+mcrypt_enc_get_iv_size\n+--SKIPIF--\n+<?php if (!extension_loaded("mcrypt")) print "skip"; ?>\n+--FILE--\n+<?php\n+$td = mcrypt_module_open(MCRYPT_RIJNDAEL_256, \'\', MCRYPT_MODE_CBC, \'\');\n+var_dump(mcrypt_enc_get_iv_size($td));\n+$td = mcrypt_module_open(MCRYPT_3DES, \'\', MCRYPT_MODE_CBC, \'\');\n+var_dump(mcrypt_enc_get_iv_size($td));\n+$td = mcrypt_module_open(MCRYPT_WAKE, \'\', MCRYPT_MODE_STREAM, \'\');\n+var_dump(mcrypt_enc_get_iv_size($td));\n+--EXPECT--\n+int(32)\n+int(8)\n+int(0)\ndiff --git a/test_phpt/ext/mcrypt/mcrypt_enc_get_key_size.phpt b/test_phpt/ext/mcrypt/mcrypt_enc_get_key_size.phpt\nnew file mode 100644\nindex 00000000..22328e14\n--- /dev/null\n+++ b/test_phpt/ext/mcrypt/mcrypt_enc_get_key_size.phpt\n@@ -0,0 +1,16 @@\n+--TEST--\n+mcrypt_enc_get_key_size\n+--SKIPIF--\n+<?php if (!extension_loaded("mcrypt")) print "skip"; ?>\n+--FILE--\n+<?php\n+$td = mcrypt_module_open(MCRYPT_RIJNDAEL_256, \'\', MCRYPT_MODE_CBC, \'\');\n+var_dump(mcrypt_enc_get_key_size($td));\n+$td = mcrypt_module_open(MCRYPT_3DES, \'\', MCRYPT_MODE_CBC, \'\');\n+var_dump(mcrypt_enc_get_key_size($td));\n+$td = mcrypt_module_open(MCRYPT_WAKE, \'\', MCRYPT_MODE_STREAM, \'\');\n+var_dump(mcrypt_enc_get_key_size($td));\n+--EXPECT--\n+int(32)\n+int(24)\n+int(32)\ndiff --git a/test_phpt/ext/mcrypt/mcrypt_enc_get_mode_name.phpt b/test_phpt/ext/mcrypt/mcrypt_enc_get_mode_name.phpt\nnew file mode 100644\nindex 00000000..21c41f98\n--- /dev/null\n+++ b/test_phpt/ext/mcrypt/mcrypt_enc_get_mode_name.phpt\n@@ -0,0 +1,25 @@\n+--TEST--\n+mcrypt_enc_get_modes_name\n+--SKIPIF--\n+<?php if (!extension_loaded("mcrypt")) print "skip"; ?>\n+--FILE--\n+<?php\n+$td  = mcrypt_module_open(\'rijndael-128\', \'\', MCRYPT_MODE_ECB, \'\');\n+echo mcrypt_enc_get_modes_name($td) . "\\n";\n+$td  = mcrypt_module_open(MCRYPT_RIJNDAEL_128, \'\', MCRYPT_MODE_CBC, \'\');\n+echo mcrypt_enc_get_modes_name($td) . "\\n";\n+$td  = mcrypt_module_open(MCRYPT_WAKE, \'\', MCRYPT_MODE_STREAM, \'\');\n+echo mcrypt_enc_get_modes_name($td) . "\\n";\n+$td  = mcrypt_module_open(MCRYPT_BLOWFISH, \'\', MCRYPT_MODE_OFB, \'\');\n+echo mcrypt_enc_get_modes_name($td) . "\\n";\n+$td  = mcrypt_module_open(\'des\', \'\', \'ecb\', \'\');\n+echo mcrypt_enc_get_modes_name($td) . "\\n";\n+$td  = mcrypt_module_open(\'des\', \'\', \'cbc\', \'\');\n+echo mcrypt_enc_get_modes_name($td) . "\\n";\n+--EXPECT--\n+ECB\n+CBC\n+STREAM\n+OFB\n+ECB\n+CBC\ndiff --git a/test_phpt/ext/mcrypt/mcrypt_enc_get_supported_key_sizes.phpt b/test_phpt/ext/mcrypt/mcrypt_enc_get_supported_key_sizes.phpt\nnew file mode 100644\nindex 00000000..0ce1f15c\n--- /dev/null\n+++ b/test_phpt/ext/mcrypt/mcrypt_enc_get_supported_key_sizes.phpt\n@@ -0,0 +1,18 @@\n+--TEST--\n+mcrypt_enc_get_supported_key_sizes\n+--SKIPIF--\n+<?php if (!extension_loaded("mcrypt")) print "skip"; ?>\n+--FILE--\n+<?php\n+$td  = mcrypt_module_open(\'rijndael-256\', \'\', \'ecb\', \'\');\n+$var = mcrypt_enc_get_supported_key_sizes($td);\n+var_dump($var);\n+--EXPECT--\n+array(3) {\n+  [0]=>\n+  int(16)\n+  [1]=>\n+  int(24)\n+  [2]=>\n+  int(32)\n+}\n\\ No newline at end of file\ndiff --git a/test_phpt/ext/mcrypt/mcrypt_enc_is_block_algorithm.phpt b/test_phpt/ext/mcrypt/mcrypt_enc_is_block_algorithm.phpt\nnew file mode 100644\nindex 00000000..21a0ed2b\n--- /dev/null\n+++ b/test_phpt/ext/mcrypt/mcrypt_enc_is_block_algorithm.phpt\n@@ -0,0 +1,16 @@\n+--TEST--\n+mcrypt_enc_is_block_algorithm\n+--SKIPIF--\n+<?php if (!extension_loaded("mcrypt")) print "skip"; ?>\n+--FILE--\n+<?php\n+$td = mcrypt_module_open(MCRYPT_RIJNDAEL_256, \'\', MCRYPT_MODE_CBC, \'\');\n+var_dump(mcrypt_enc_is_block_algorithm($td));\n+$td = mcrypt_module_open(MCRYPT_3DES, \'\', MCRYPT_MODE_CBC, \'\');\n+var_dump(mcrypt_enc_is_block_algorithm($td));\n+$td = mcrypt_module_open(MCRYPT_WAKE, \'\', MCRYPT_MODE_STREAM, \'\');\n+var_dump(mcrypt_enc_is_block_algorithm($td));\n+--EXPECT--\n+bool(true)\n+bool(true)\n+bool(false)\ndiff --git a/test_phpt/ext/mcrypt/mcrypt_enc_is_block_algorithm_mode.phpt b/test_phpt/ext/mcrypt/mcrypt_enc_is_block_algorithm_mode.phpt\nnew file mode 100644\nindex 00000000..69c96541\n--- /dev/null\n+++ b/test_phpt/ext/mcrypt/mcrypt_enc_is_block_algorithm_mode.phpt\n@@ -0,0 +1,16 @@\n+--TEST--\n+mcrypt_enc_is_block_algorithm_mode\n+--SKIPIF--\n+<?php if (!extension_loaded("mcrypt")) print "skip"; ?>\n+--FILE--\n+<?php\n+$td = mcrypt_module_open(MCRYPT_RIJNDAEL_256, \'\', MCRYPT_MODE_ECB, \'\');\n+var_dump(mcrypt_enc_is_block_algorithm_mode($td));\n+$td = mcrypt_module_open(MCRYPT_RIJNDAEL_256, \'\', MCRYPT_MODE_CBC, \'\');\n+var_dump(mcrypt_enc_is_block_algorithm_mode($td));\n+$td = mcrypt_module_open(MCRYPT_WAKE, \'\',  MCRYPT_MODE_STREAM, \'\');\n+var_dump(mcrypt_enc_is_block_algorithm_mode($td));\n+--EXPECT--\n+bool(true)\n+bool(true)\n+bool(false)\ndiff --git a/test_phpt/ext/mcrypt/mcrypt_enc_is_block_mode.phpt b/test_phpt/ext/mcrypt/mcrypt_enc_is_block_mode.phpt\nnew file mode 100644\nindex 00000000..551f7a69\n--- /dev/null\n+++ b/test_phpt/ext/mcrypt/mcrypt_enc_is_block_mode.phpt\n@@ -0,0 +1,19 @@\n+--TEST--\n+mcrypt_enc_is_block_mode\n+--SKIPIF--\n+<?php if (!extension_loaded("mcrypt")) print "skip"; ?>\n+--FILE--\n+<?php\n+$td = mcrypt_module_open(MCRYPT_RIJNDAEL_256, \'\', MCRYPT_MODE_CBC, \'\');\n+var_dump(mcrypt_enc_is_block_mode($td));\n+$td = mcrypt_module_open(MCRYPT_RIJNDAEL_256, \'\', MCRYPT_MODE_ECB, \'\');\n+var_dump(mcrypt_enc_is_block_mode($td));\n+$td = mcrypt_module_open(MCRYPT_ARCFOUR, \'\', MCRYPT_MODE_STREAM, \'\');\n+var_dump(mcrypt_enc_is_block_mode($td));\n+$td = mcrypt_module_open(MCRYPT_WAKE, \'\', MCRYPT_MODE_STREAM, \'\');\n+var_dump(mcrypt_enc_is_block_mode($td));\n+--EXPECT--\n+bool(true)\n+bool(true)\n+bool(false)\n+bool(false)\n\\ No newline at end of file\ndiff --git a/test_phpt/ext/mcrypt/mcrypt_enc_self_test.phpt b/test_phpt/ext/mcrypt/mcrypt_enc_self_test.phpt\nnew file mode 100644\nindex 00000000..a161e0e0\n--- /dev/null\n+++ b/test_phpt/ext/mcrypt/mcrypt_enc_self_test.phpt\n@@ -0,0 +1,10 @@\n+--TEST--\n+mcrypt_enc_self_test\n+--SKIPIF--\n+<?php if (!extension_loaded("mcrypt")) print "skip"; ?>\n+--FILE--\n+<?php\n+$td = mcrypt_module_open(MCRYPT_RIJNDAEL_256, \'\', MCRYPT_MODE_CBC, \'\');\n+var_dump(mcrypt_enc_self_test($td));\n+--EXPECT--\n+int(0)\n\\ No newline at end of file\ndiff --git a/test_phpt/ext/mcrypt/mcrypt_encrypt_3des_cbc.phpt b/test_phpt/ext/mcrypt/mcrypt_encrypt_3des_cbc.phpt\nnew file mode 100644\nindex 00000000..f86bd392\n--- /dev/null\n+++ b/test_phpt/ext/mcrypt/mcrypt_encrypt_3des_cbc.phpt\n@@ -0,0 +1,94 @@\n+--TEST--\n+Test mcrypt_encrypt() function : TripleDES functionality \n+--SKIPIF--\n+<?php \n+if (!extension_loaded("mcrypt")) {\n+\tprint "skip - mcrypt extension not loaded"; \n+}\t \n+?>\n+--FILE--\n+<?php\n+/* Prototype  : string mcrypt_encrypt(string cipher, string key, string data, string mode, string iv)\n+ * Description: OFB crypt/decrypt data using key key with cipher cipher starting with iv \n+ * Source code: ext/mcrypt/mcrypt.c\n+ * Alias to functions: \n+ */\n+\n+echo "*** Testing mcrypt_encrypt() : TripleDES functionality ***\\n";\n+\n+//test CBC, ECB modes\n+//test encrypt decrypt\n+//test tripledes, aes\n+//test different lengths of key, iv\n+//test no iv being passed on CBC, ECB \n+//test upto 32 bytes with unlimited strength\n+\n+$cipher = MCRYPT_TRIPLEDES;\n+$mode = MCRYPT_MODE_CBC;\n+$data = b\'This is the secret message which must be encrypted\';\n+\n+// tripledes uses keys upto 192 bits (24 bytes)\n+$keys = array(\n+   b\'12345678\', \n+   b\'12345678901234567890\', \n+   b\'123456789012345678901234\', \n+   b\'12345678901234567890123456\'\n+);\n+// tripledes is a block cipher of 64 bits (8 bytes)\n+$ivs = array(\n+   b\'1234\', \n+   b\'12345678\', \n+   b\'123456789\'\n+);\n+\n+\n+$iv = b\'12345678\';\n+echo "\\n--- testing different key lengths\\n";\n+foreach ($keys as $key) {\n+   echo "\\nkey length=".strlen($key)."\\n";\n+   var_dump(bin2hex(mcrypt_encrypt($cipher, $key, $data, $mode, $iv)));\n+}\n+\n+$key = b\'1234567890123456\';  \n+echo "\\n--- testing different iv lengths\\n";\n+foreach ($ivs as $iv) {\n+   echo "\\niv length=".strlen($iv)."\\n";\n+   var_dump(bin2hex(mcrypt_encrypt($cipher, $key, $data, $mode, $iv)));\n+}\n+\n+?>\n+===DONE===\n+--EXPECTF--\n+*** Testing mcrypt_encrypt() : TripleDES functionality ***\n+\n+--- testing different key lengths\n+\n+key length=8\n+string(112) "082b437d039d09418e20dc9de1dafa7ed6da5c6335b78950968441da1faf40c1f886e04da8ca177b80b376811e138c1bf51cb48dae2e7939"\n+\n+key length=20\n+string(112) "0627351e0f8a082bf7981ae2c700a43fd3d44b270ac67b00fded1c5796eea935be0fef2a23da0b3f5e243929e62ac957bf0bf463aa90fc4f"\n+\n+key length=24\n+string(112) "b85e21072239d60c63a80e7c9ae493cb741a1cd407e52f451c5f43a0d103f55a7b62617eb2e44213c2d44462d388bc0b8f119384b12c84ac"\n+\n+key length=26\n+\n+Warning: mcrypt_encrypt(): Size of key is too large for this algorithm in %s on line %d\n+string(112) "b85e21072239d60c63a80e7c9ae493cb741a1cd407e52f451c5f43a0d103f55a7b62617eb2e44213c2d44462d388bc0b8f119384b12c84ac"\n+\n+--- testing different iv lengths\n+\n+iv length=4\n+\n+Warning: mcrypt_encrypt(): The IV parameter must be as long as the blocksize in %s on line %d\n+string(112) "440a6f54601969b127aad3c217ce7583c7f7b29989693130645569301db0020b29a34a3dcd104b2d0e3ba19d6cbd8a33d352b9c27cc34ef1"\n+\n+iv length=8\n+string(112) "bac347506bf092c5557c4363c301745d78f047028e2953e84fd66b30aeb6005812dadbe8baa871b83278341599b0c448ddaaa52b5a378ce5"\n+\n+iv length=9\n+\n+Warning: mcrypt_encrypt(): The IV parameter must be as long as the blocksize in %s on line %d\n+string(112) "440a6f54601969b127aad3c217ce7583c7f7b29989693130645569301db0020b29a34a3dcd104b2d0e3ba19d6cbd8a33d352b9c27cc34ef1"\n+===DONE===\ndiff --git a/test_phpt/ext/mcrypt/mcrypt_encrypt_3des_ecb.phpt b/test_phpt/ext/mcrypt/mcrypt_encrypt_3des_ecb.phpt\nnew file mode 100644\nindex 00000000..1b3188f8\n--- /dev/null\n+++ b/test_phpt/ext/mcrypt/mcrypt_encrypt_3des_ecb.phpt\n@@ -0,0 +1,82 @@\n+--TEST--\n+Test mcrypt_encrypt() function : TripleDES functionality\n+--SKIPIF--\n+<?php \n+if (!extension_loaded("mcrypt")) {\n+\tprint "skip - mcrypt extension not loaded"; \n+}\t \n+?>\n+--FILE--\n+<?php\n+/* Prototype  : string mcrypt_encrypt(string cipher, string key, string data, string mode, string iv)\n+ * Description: OFB crypt/decrypt data using key key with cipher cipher starting with iv \n+ * Source code: ext/mcrypt/mcrypt.c\n+ * Alias to functions: \n+ */\n+\n+echo "*** Testing mcrypt_encrypt() : TripleDES functionality ***\\n";\n+\n+$cipher = MCRYPT_TRIPLEDES;\n+$mode = MCRYPT_MODE_ECB;\n+$data = b\'This is the secret message which must be encrypted\';\n+\n+// tripledes uses keys upto 192 bits (24 bytes)\n+$keys = array(\n+   b\'12345678\', \n+   b\'12345678901234567890\', \n+   b\'123456789012345678901234\', \n+   b\'12345678901234567890123456\'\n+);\n+\n+echo "\\n--- testing different key lengths\\n";\n+foreach ($keys as $key) {\n+   echo "\\nkey length=".strlen($key)."\\n";\n+   var_dump(bin2hex(mcrypt_encrypt($cipher, $key, $data, $mode)));\n+}\n+\n+$key = b\'12345678\';  \n+$ivs = array(\n+   b\'1234\', \n+   b\'12345678\', \n+   b\'123456789\'\n+);\n+\n+// ivs should be ignored in ecb mode\n+echo "\\n--- testing different iv lengths\\n";\n+foreach ($ivs as $iv) {\n+   echo "\\niv length=".strlen($iv)."\\n";\n+   var_dump(bin2hex(mcrypt_encrypt($cipher, $key, $data, $mode, $iv)));\n+}\n+\n+?>\n+===DONE===\n+--EXPECTF--\n+*** Testing mcrypt_encrypt() : TripleDES functionality ***\n+\n+--- testing different key lengths\n+\n+key length=8\n+string(112) "05c9c4cafb9937d950bdae60ee3abcb8d9f3e1f1fac8acaaa5b11d70b7ca02f3b76d447ab3dd85a4b5df5dedb4b4654595ccdf6da97fa93f"\n+\n+key length=20\n+string(112) "0fc7045c4fb4dbcf44baf9ed15ab40331a42ff0632318a16b12ed5873f02e7945e4f63f408d6849534cbb7419c22c8854aaa85e0e05a28e6"\n+\n+key length=24\n+string(112) "923eedcb20e18e3efa466a6ca1b842b34e6ac46aa3690ef739d0d68a26eb64e1a6ad42e7d18312ae8a57ab927e1dc892e5ff56c061864f27"\n+\n+key length=26\n+\n+Warning: mcrypt_encrypt(): Size of key is too large for this algorithm in %s on line %d\n+string(112) "923eedcb20e18e3efa466a6ca1b842b34e6ac46aa3690ef739d0d68a26eb64e1a6ad42e7d18312ae8a57ab927e1dc892e5ff56c061864f27"\n+\n+--- testing different iv lengths\n+\n+iv length=4\n+string(112) "05c9c4cafb9937d950bdae60ee3abcb8d9f3e1f1fac8acaaa5b11d70b7ca02f3b76d447ab3dd85a4b5df5dedb4b4654595ccdf6da97fa93f"\n+\n+iv length=8\n+string(112) "05c9c4cafb9937d950bdae60ee3abcb8d9f3e1f1fac8acaaa5b11d70b7ca02f3b76d447ab3dd85a4b5df5dedb4b4654595ccdf6da97fa93f"\n+\n+iv length=9\n+string(112) "05c9c4cafb9937d950bdae60ee3abcb8d9f3e1f1fac8acaaa5b11d70b7ca02f3b76d447ab3dd85a4b5df5dedb4b4654595ccdf6da97fa93f"\n+===DONE===\ndiff --git a/test_phpt/ext/mcrypt/mcrypt_encrypt_error.phpt b/test_phpt/ext/mcrypt/mcrypt_encrypt_error.phpt\nnew file mode 100644\nindex 00000000..04226c20\n--- /dev/null\n+++ b/test_phpt/ext/mcrypt/mcrypt_encrypt_error.phpt\n@@ -0,0 +1,52 @@\n+--TEST--\n+Test mcrypt_encrypt() function : error conditions \n+--SKIPIF--\n+<?php \n+if (!extension_loaded("mcrypt")) {\n+\tprint "skip - mcrypt extension not loaded"; \n+}\t \n+?>\n+--FILE--\n+<?php\n+/* Prototype  : string mcrypt_encrypt(string cipher, string key, string data, string mode, string iv)\n+ * Description: OFB crypt/decrypt data using key key with cipher cipher starting with iv \n+ * Source code: ext/mcrypt/mcrypt.c\n+ * Alias to functions: \n+ */\n+\n+echo "*** Testing mcrypt_encrypt() : error conditions ***\\n";\n+\n+\n+//Test mcrypt_encrypt with one more than the expected number of arguments\n+echo "\\n-- Testing mcrypt_encrypt() function with more than expected no. of arguments --\\n";\n+$cipher = \'string_val\';\n+$key = \'string_val\';\n+$data = \'string_val\';\n+$mode = \'string_val\';\n+$iv = \'string_val\';\n+$extra_arg = 10;\n+var_dump( mcrypt_encrypt($cipher, $key, $data, $mode, $iv, $extra_arg) );\n+\n+// Testing mcrypt_encrypt with one less than the expected number of arguments\n+echo "\\n-- Testing mcrypt_encrypt() function with less than expected no. of arguments --\\n";\n+$cipher = \'string_val\';\n+$key = \'string_val\';\n+$data = \'string_val\';\n+var_dump( mcrypt_encrypt($cipher, $key, $data) );\n+\n+?>\n+===DONE===\n+--EXPECTF--\n+*** Testing mcrypt_encrypt() : error conditions ***\n+\n+-- Testing mcrypt_encrypt() function with more than expected no. of arguments --\n+\n+Warning: mcrypt_encrypt() expects at most 5 parameters, 6 given in %s on line %d\n+NULL\n+\n+-- Testing mcrypt_encrypt() function with less than expected no. of arguments --\n+\n+Warning: mcrypt_encrypt() expects at least 4 parameters, 3 given in %s on line %d\n+NULL\n+===DONE===\n+\ndiff --git a/test_phpt/ext/mcrypt/mcrypt_encrypt_variation1.phpt b/test_phpt/ext/mcrypt/mcrypt_encrypt_variation1.phpt\nnew file mode 100644\nindex 00000000..fdbd901a\n--- /dev/null\n+++ b/test_phpt/ext/mcrypt/mcrypt_encrypt_variation1.phpt\n@@ -0,0 +1,230 @@\n+--TEST--\n+Test mcrypt_encrypt() function : usage variation - different types for cipher\n+--SKIPIF--\n+<?php \n+if (!extension_loaded("mcrypt")) {\n+\tprint "skip - mcrypt extension not loaded"; \n+}\t \n+?>\n+--FILE--\n+<?php\n+/* Prototype  : string mcrypt_encrypt(string cipher, string key, string data, string mode, string iv)\n+ * Description: OFB crypt/decrypt data using key key with cipher cipher starting with iv \n+ * Source code: ext/mcrypt/mcrypt.c\n+ * Alias to functions: \n+ */\n+\n+echo "*** Testing mcrypt_encrypt() : usage variation ***\\n";\n+\n+// Define error handler\n+function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {\n+\tif (error_reporting() != 0) {\n+\t\t// report non-silenced errors\n+\t\techo "Error: $err_no - $err_msg, $filename($linenum)\\n";\n+\t}\n+}\n+set_error_handler(\'test_error_handler\');\n+\n+// Initialise function arguments not being substituted (if any)\n+$key = b\'string_val\';\n+$data = b\'string_val\';\n+$mode = MCRYPT_MODE_ECB;\n+$iv = b\'string_val\';\n+\n+//get an unset variable\n+$unset_var = 10;\n+unset ($unset_var);\n+\n+// define some classes\n+class classWithToString\n+{\n+\tpublic function __toString() {\n+\t\treturn "Class A object";\n+\t}\n+}\n+\n+class classWithoutToString\n+{\n+}\n+\n+// heredoc string\n+$heredoc = <<<EOT\n+hello world\n+EOT;\n+\n+// get a resource variable\n+$fp = fopen(__FILE__, "r");\n+\n+// add arrays\n+$index_array = array (1, 2, 3);\n+$assoc_array = array (\'one\' => 1, \'two\' => 2);\n+\n+//array of values to iterate over\n+$inputs = array(\n+\n+      // int data\n+      \'int 0\' => 0,\n+      \'int 1\' => 1,\n+      \'int 12345\' => 12345,\n+      \'int -12345\' => -2345,\n+\n+      // float data\n+      \'float 10.5\' => 10.5,\n+      \'float -10.5\' => -10.5,\n+      \'float 12.3456789000e10\' => 12.3456789000e10,\n+      \'float -12.3456789000e10\' => -12.3456789000e10,\n+      \'float .5\' => .5,\n+\n+      // array data\n+      \'empty array\' => array(),\n+      \'int indexed array\' => $index_array,\n+      \'associative array\' => $assoc_array,\n+      \'nested arrays\' => array(\'foo\', $index_array, $assoc_array),\n+\n+      // null data\n+      \'uppercase NULL\' => NULL,\n+      \'lowercase null\' => null,\n+\n+      // boolean data\n+      \'lowercase true\' => true,\n+      \'lowercase false\' =>false,\n+      \'uppercase TRUE\' =>TRUE,\n+      \'uppercase FALSE\' =>FALSE,\n+\n+      // empty data\n+      \'empty string DQ\' => "",\n+      \'empty string SQ\' => \'\',\n+\n+      // object data\n+      \'instance of classWithToString\' => new classWithToString(),\n+      \'instance of classWithoutToString\' => new classWithoutToString(),\n+\n+      // undefined data\n+      \'undefined var\' => @$undefined_var,\n+\n+      // unset data\n+      \'unset var\' => @$unset_var,\n+      \n+      // resource variable\n+      \'resource\' => $fp      \n+);\n+\n+// loop through each element of the array for cipher\n+\n+foreach($inputs as $valueType =>$value) {\n+      echo "\\n--$valueType--\\n";\n+      var_dump( mcrypt_encrypt($value, $key, $data, $mode, $iv) );\n+};\n+\n+fclose($fp);\n+\n+?>\n+===DONE===\n+--EXPECTF--\n+*** Testing mcrypt_encrypt() : usage variation ***\n+\n+--int 0--\n+Error: 2 - mcrypt_encrypt(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--int 1--\n+Error: 2 - mcrypt_encrypt(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--int 12345--\n+Error: 2 - mcrypt_encrypt(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--int -12345--\n+Error: 2 - mcrypt_encrypt(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--float 10.5--\n+Error: 2 - mcrypt_encrypt(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--float -10.5--\n+Error: 2 - mcrypt_encrypt(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--float 12.3456789000e10--\n+Error: 2 - mcrypt_encrypt(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--float -12.3456789000e10--\n+Error: 2 - mcrypt_encrypt(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--float .5--\n+Error: 2 - mcrypt_encrypt(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--empty array--\n+Error: 2 - mcrypt_encrypt() expects parameter 1 to be string, array given, %s(%d)\n+NULL\n+\n+--int indexed array--\n+Error: 2 - mcrypt_encrypt() expects parameter 1 to be string, array given, %s(%d)\n+NULL\n+\n+--associative array--\n+Error: 2 - mcrypt_encrypt() expects parameter 1 to be string, array given, %s(%d)\n+NULL\n+\n+--nested arrays--\n+Error: 2 - mcrypt_encrypt() expects parameter 1 to be string, array given, %s(%d)\n+NULL\n+\n+--uppercase NULL--\n+Error: 2 - mcrypt_encrypt(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--lowercase null--\n+Error: 2 - mcrypt_encrypt(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--lowercase true--\n+Error: 2 - mcrypt_encrypt(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--lowercase false--\n+Error: 2 - mcrypt_encrypt(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--uppercase TRUE--\n+Error: 2 - mcrypt_encrypt(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--uppercase FALSE--\n+Error: 2 - mcrypt_encrypt(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--empty string DQ--\n+Error: 2 - mcrypt_encrypt(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--empty string SQ--\n+Error: 2 - mcrypt_encrypt(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--instance of classWithToString--\n+Error: 2 - mcrypt_encrypt(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--instance of classWithoutToString--\n+Error: 2 - mcrypt_encrypt() expects parameter 1 to be string, object given, %s(%d)\n+NULL\n+\n+--undefined var--\n+Error: 2 - mcrypt_encrypt(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--unset var--\n+Error: 2 - mcrypt_encrypt(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--resource--\n+Error: 2 - mcrypt_encrypt() expects parameter 1 to be string, resource given, %s(%d)\n+NULL\n+===DONE===\n+\ndiff --git a/test_phpt/ext/mcrypt/mcrypt_encrypt_variation2.phpt b/test_phpt/ext/mcrypt/mcrypt_encrypt_variation2.phpt\nnew file mode 100644\nindex 00000000..0f4fd0fe\n--- /dev/null\n+++ b/test_phpt/ext/mcrypt/mcrypt_encrypt_variation2.phpt\n@@ -0,0 +1,210 @@\n+--TEST--\n+Test mcrypt_encrypt() function : usage variation \n+--SKIPIF--\n+<?php \n+if (!extension_loaded("mcrypt")) {\n+\tprint "skip - mcrypt extension not loaded"; \n+}\t \n+?>\n+--FILE--\n+<?php\n+/* Prototype  : string mcrypt_encrypt(string cipher, string key, string data, string mode, string iv)\n+ * Description: OFB crypt/decrypt data using key key with cipher cipher starting with iv \n+ * Source code: ext/mcrypt/mcrypt.c\n+ * Alias to functions: \n+ */\n+\n+echo "*** Testing mcrypt_encrypt() : usage variation ***\\n";\n+\n+// Define error handler\n+function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {\n+\tif (error_reporting() != 0) {\n+\t\t// report non-silenced errors\n+\t\techo "Error: $err_no - $err_msg, $filename($linenum)\\n";\n+\t}\n+}\n+set_error_handler(\'test_error_handler\');\n+\n+// Initialise function arguments not being substituted (if any)\n+$cipher = MCRYPT_TRIPLEDES;\n+$data = b\'string_val\';\n+$mode = MCRYPT_MODE_ECB;\n+$iv = b\'01234567\';\n+\n+//get an unset variable\n+$unset_var = 10;\n+unset ($unset_var);\n+\n+// define some classes\n+class classWithToString\n+{\n+\tpublic function __toString() {\n+\t\treturn b"Class A object";\n+\t}\n+}\n+\n+class classWithoutToString\n+{\n+}\n+\n+// heredoc string\n+$heredoc = b<<<EOT\n+hello world\n+EOT;\n+\n+// get a resource variable\n+$fp = fopen(__FILE__, "r");\n+\n+// add arrays\n+$index_array = array (1, 2, 3);\n+$assoc_array = array (\'one\' => 1, \'two\' => 2);\n+\n+//array of values to iterate over\n+$inputs = array(\n+\n+      // int data\n+      \'int 0\' => 0,\n+      \'int 1\' => 1,\n+      \'int 12345\' => 12345,\n+      \'int -12345\' => -2345,\n+\n+      // float data\n+      \'float 10.5\' => 10.5,\n+      \'float -10.5\' => -10.5,\n+      \'float 12.3456789000e10\' => 12.3456789000e10,\n+      \'float -12.3456789000e10\' => -12.3456789000e10,\n+      \'float .5\' => .5,\n+\n+      // array data\n+      \'empty array\' => array(),\n+      \'int indexed array\' => $index_array,\n+      \'associative array\' => $assoc_array,\n+      \'nested arrays\' => array(\'foo\', $index_array, $assoc_array),\n+\n+      // null data\n+      \'uppercase NULL\' => NULL,\n+      \'lowercase null\' => null,\n+\n+      // boolean data\n+      \'lowercase true\' => true,\n+      \'lowercase false\' =>false,\n+      \'uppercase TRUE\' =>TRUE,\n+      \'uppercase FALSE\' =>FALSE,\n+\n+      // empty data\n+      \'empty string DQ\' => "",\n+      \'empty string SQ\' => \'\',\n+\n+      // object data\n+      \'instance of classWithToString\' => new classWithToString(),\n+      \'instance of classWithoutToString\' => new classWithoutToString(),\n+\n+      // undefined data\n+      \'undefined var\' => @$undefined_var,\n+\n+      // unset data\n+      \'unset var\' => @$unset_var,\n+      \n+      // resource variable\n+      \'resource\' => $fp      \n+);\n+\n+// loop through each element of the array for key\n+\n+foreach($inputs as $valueType =>$value) {\n+      echo "\\n--$valueType--\\n";\n+      var_dump( bin2hex(mcrypt_encrypt($cipher, $value, $data, $mode, $iv) ));\n+};\n+\n+fclose($fp);\n+\n+?>\n+===DONE===\n+--EXPECTF--\n+*** Testing mcrypt_encrypt() : usage variation ***\n+\n+--int 0--\n+string(32) "e469e6b066f9600e1eefd8f53365f96c"\n+\n+--int 1--\n+string(32) "e469e6b066f9600e1eefd8f53365f96c"\n+\n+--int 12345--\n+string(32) "d74e5f51d1199bcfa61f80168e913007"\n+\n+--int -12345--\n+string(32) "17fe485ed735abb34c1dd4455af7b79c"\n+\n+--float 10.5--\n+string(32) "cd735509aa4013a130e011686d66ae01"\n+\n+--float -10.5--\n+string(32) "a57d99d6d5813039abf50fc50d631e47"\n+\n+--float 12.3456789000e10--\n+string(32) "f17ede0bfdaa4408f545f7f4c8b040d2"\n+\n+--float -12.3456789000e10--\n+string(32) "326f64e3b9bd5a6beb0a9b52a09a5a48"\n+\n+--float .5--\n+string(32) "2aedf7661cd4d8c7593f44c58718e2b8"\n+\n+--empty array--\n+Error: 2 - mcrypt_encrypt() expects parameter 2 to be string, array given, %s(%d)\n+string(0) ""\n+\n+--int indexed array--\n+Error: 2 - mcrypt_encrypt() expects parameter 2 to be string, array given, %s(%d)\n+string(0) ""\n+\n+--associative array--\n+Error: 2 - mcrypt_encrypt() expects parameter 2 to be string, array given, %s(%d)\n+string(0) ""\n+\n+--nested arrays--\n+Error: 2 - mcrypt_encrypt() expects parameter 2 to be string, array given, %s(%d)\n+string(0) ""\n+\n+--uppercase NULL--\n+string(32) "bfa2cb7240c8d2f6abeb34960c04f6d3"\n+\n+--lowercase null--\n+string(32) "bfa2cb7240c8d2f6abeb34960c04f6d3"\n+\n+--lowercase true--\n+string(32) "e469e6b066f9600e1eefd8f53365f96c"\n+\n+--lowercase false--\n+string(32) "bfa2cb7240c8d2f6abeb34960c04f6d3"\n+\n+--uppercase TRUE--\n+string(32) "e469e6b066f9600e1eefd8f53365f96c"\n+\n+--uppercase FALSE--\n+string(32) "bfa2cb7240c8d2f6abeb34960c04f6d3"\n+\n+--empty string DQ--\n+string(32) "bfa2cb7240c8d2f6abeb34960c04f6d3"\n+\n+--empty string SQ--\n+string(32) "bfa2cb7240c8d2f6abeb34960c04f6d3"\n+\n+--instance of classWithToString--\n+string(32) "1fd3514d8ced44d04d9dc7511fce33ef"\n+\n+--instance of classWithoutToString--\n+Error: 2 - mcrypt_encrypt() expects parameter 2 to be string, object given, %s(%d)\n+string(0) ""\n+\n+--undefined var--\n+string(32) "bfa2cb7240c8d2f6abeb34960c04f6d3"\n+\n+--unset var--\n+string(32) "bfa2cb7240c8d2f6abeb34960c04f6d3"\n+\n+--resource--\n+Error: 2 - mcrypt_encrypt() expects parameter 2 to be string, resource given, %s(%d)\n+string(0) ""\n+===DONE===\n+\ndiff --git a/test_phpt/ext/mcrypt/mcrypt_encrypt_variation3.phpt b/test_phpt/ext/mcrypt/mcrypt_encrypt_variation3.phpt\nnew file mode 100644\nindex 00000000..c4725406\n--- /dev/null\n+++ b/test_phpt/ext/mcrypt/mcrypt_encrypt_variation3.phpt\n@@ -0,0 +1,210 @@\n+--TEST--\n+Test mcrypt_encrypt() function : usage variation\n+--SKIPIF--\n+<?php \n+if (!extension_loaded("mcrypt")) {\n+\tprint "skip - mcrypt extension not loaded"; \n+}\t \n+?> \n+--FILE--\n+<?php\n+/* Prototype  : string mcrypt_encrypt(string cipher, string key, string data, string mode, string iv)\n+ * Description: OFB crypt/decrypt data using key key with cipher cipher starting with iv \n+ * Source code: ext/mcrypt/mcrypt.c\n+ * Alias to functions: \n+ */\n+\n+echo "*** Testing mcrypt_encrypt() : usage variation ***\\n";\n+\n+// Define error handler\n+function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {\n+\tif (error_reporting() != 0) {\n+\t\t// report non-silenced errors\n+\t\techo "Error: $err_no - $err_msg, $filename($linenum)\\n";\n+\t}\n+}\n+set_error_handler(\'test_error_handler\');\n+\n+// Initialise function arguments not being substituted (if any)\n+$cipher = MCRYPT_TRIPLEDES;\n+$key = b\'string_val\';\n+$mode = MCRYPT_MODE_ECB;\n+$iv = b\'01234567\';\n+\n+//get an unset variable\n+$unset_var = 10;\n+unset ($unset_var);\n+\n+// define some classes\n+class classWithToString\n+{\n+\tpublic function __toString() {\n+\t\treturn b"Class A object";\n+\t}\n+}\n+\n+class classWithoutToString\n+{\n+}\n+\n+// heredoc string\n+$heredoc = b<<<EOT\n+hello world\n+EOT;\n+\n+// get a resource variable\n+$fp = fopen(__FILE__, "r");\n+\n+// add arrays\n+$index_array = array (1, 2, 3);\n+$assoc_array = array (\'one\' => 1, \'two\' => 2);\n+\n+//array of values to iterate over\n+$inputs = array(\n+\n+      // int data\n+      \'int 0\' => 0,\n+      \'int 1\' => 1,\n+      \'int 12345\' => 12345,\n+      \'int -12345\' => -2345,\n+\n+      // float data\n+      \'float 10.5\' => 10.5,\n+      \'float -10.5\' => -10.5,\n+      \'float 12.3456789000e10\' => 12.3456789000e10,\n+      \'float -12.3456789000e10\' => -12.3456789000e10,\n+      \'float .5\' => .5,\n+\n+      // array data\n+      \'empty array\' => array(),\n+      \'int indexed array\' => $index_array,\n+      \'associative array\' => $assoc_array,\n+      \'nested arrays\' => array(\'foo\', $index_array, $assoc_array),\n+\n+      // null data\n+      \'uppercase NULL\' => NULL,\n+      \'lowercase null\' => null,\n+\n+      // boolean data\n+      \'lowercase true\' => true,\n+      \'lowercase false\' =>false,\n+      \'uppercase TRUE\' =>TRUE,\n+      \'uppercase FALSE\' =>FALSE,\n+\n+      // empty data\n+      \'empty string DQ\' => "",\n+      \'empty string SQ\' => \'\',\n+\n+      // object data\n+      \'instance of classWithToString\' => new classWithToString(),\n+      \'instance of classWithoutToString\' => new classWithoutToString(),\n+\n+      // undefined data\n+      \'undefined var\' => @$undefined_var,\n+\n+      // unset data\n+      \'unset var\' => @$unset_var,\n+      \n+      // resource variable\n+      \'resource\' => $fp      \n+);\n+\n+// loop through each element of the array for data\n+\n+foreach($inputs as $valueType =>$value) {\n+      echo "\\n--$valueType--\\n";\n+      var_dump( bin2hex(mcrypt_encrypt($cipher, $key, $value, $mode, $iv) ));\n+};\n+\n+fclose($fp);\n+\n+?>\n+===DONE===\n+--EXPECTF--\n+*** Testing mcrypt_encrypt() : usage variation ***\n+\n+--int 0--\n+string(16) "51dc9cd9179b718b"\n+\n+--int 1--\n+string(16) "619c335f8c4f9cbf"\n+\n+--int 12345--\n+string(16) "b1258d67ab73de00"\n+\n+--int -12345--\n+string(16) "8eecf134443bd6b9"\n+\n+--float 10.5--\n+string(16) "34b5750a793baff5"\n+\n+--float -10.5--\n+string(16) "7a605f2aacc8a11d"\n+\n+--float 12.3456789000e10--\n+string(32) "74a0d7026ae586f476d4b17808851e86"\n+\n+--float -12.3456789000e10--\n+string(32) "bfb155997017986c01090afebd62c7ca"\n+\n+--float .5--\n+string(16) "cc60ac201164b6c7"\n+\n+--empty array--\n+Error: 2 - mcrypt_encrypt() expects parameter 3 to be string, array given, %s(%d)\n+string(0) ""\n+\n+--int indexed array--\n+Error: 2 - mcrypt_encrypt() expects parameter 3 to be string, array given, %s(%d)\n+string(0) ""\n+\n+--associative array--\n+Error: 2 - mcrypt_encrypt() expects parameter 3 to be string, array given, %s(%d)\n+string(0) ""\n+\n+--nested arrays--\n+Error: 2 - mcrypt_encrypt() expects parameter 3 to be string, array given, %s(%d)\n+string(0) ""\n+\n+--uppercase NULL--\n+string(16) "6ece228c41457539"\n+\n+--lowercase null--\n+string(16) "6ece228c41457539"\n+\n+--lowercase true--\n+string(16) "619c335f8c4f9cbf"\n+\n+--lowercase false--\n+string(16) "6ece228c41457539"\n+\n+--uppercase TRUE--\n+string(16) "619c335f8c4f9cbf"\n+\n+--uppercase FALSE--\n+string(16) "6ece228c41457539"\n+\n+--empty string DQ--\n+string(16) "6ece228c41457539"\n+\n+--empty string SQ--\n+string(16) "6ece228c41457539"\n+\n+--instance of classWithToString--\n+string(32) "749c3b4d16731d98370128754b7c930f"\n+\n+--instance of classWithoutToString--\n+Error: 2 - mcrypt_encrypt() expects parameter 3 to be string, object given, %s(%d)\n+string(0) ""\n+\n+--undefined var--\n+string(16) "6ece228c41457539"\n+\n+--unset var--\n+string(16) "6ece228c41457539"\n+\n+--resource--\n+Error: 2 - mcrypt_encrypt() expects parameter 3 to be string, resource given, %s(%d)\n+string(0) ""\n+===DONE===\n+\ndiff --git a/test_phpt/ext/mcrypt/mcrypt_encrypt_variation4.phpt b/test_phpt/ext/mcrypt/mcrypt_encrypt_variation4.phpt\nnew file mode 100644\nindex 00000000..4c8cef1d\n--- /dev/null\n+++ b/test_phpt/ext/mcrypt/mcrypt_encrypt_variation4.phpt\n@@ -0,0 +1,235 @@\n+--TEST--\n+Test mcrypt_encrypt() function : usage variation \n+--SKIPIF--\n+<?php \n+if (!extension_loaded("mcrypt")) {\n+\tprint "skip - mcrypt extension not loaded"; \n+}\t \n+?>\n+--FILE--\n+<?php\n+/* Prototype  : string mcrypt_encrypt(string cipher, string key, string data, string mode, string iv)\n+ * Description: OFB crypt/decrypt data using key key with cipher cipher starting with iv \n+ * Source code: ext/mcrypt/mcrypt.c\n+ * Alias to functions: \n+ */\n+\n+echo "*** Testing mcrypt_encrypt() : usage variation ***\\n";\n+\n+// Define error handler\n+function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {\n+\tif (error_reporting() != 0) {\n+\t\t// report non-silenced errors\n+\t\techo "Error: $err_no - $err_msg, $filename($linenum)\\n";\n+\t}\n+}\n+set_error_handler(\'test_error_handler\');\n+\n+// Initialise function arguments not being substituted (if any)\n+$cipher = MCRYPT_TRIPLEDES;\n+$key = b\'string_val\';\n+$data = b\'string_val\';\n+$iv = b\'01234567\';\n+\n+//get an unset variable\n+$unset_var = 10;\n+unset ($unset_var);\n+\n+// define some classes\n+class classWithToString\n+{\n+\tpublic function __toString() {\n+\t\treturn "Class A object";\n+\t}\n+}\n+\n+class classWithoutToString\n+{\n+}\n+\n+// heredoc string\n+$heredoc = <<<EOT\n+hello world\n+EOT;\n+\n+// get a resource variable\n+$fp = fopen(__FILE__, "r");\n+\n+// add arrays\n+$index_array = array (1, 2, 3);\n+$assoc_array = array (\'one\' => 1, \'two\' => 2);\n+\n+//array of values to iterate over\n+$inputs = array(\n+\n+      // int data\n+      \'int 0\' => 0,\n+      \'int 1\' => 1,\n+      \'int 12345\' => 12345,\n+      \'int -12345\' => -2345,\n+\n+      // float data\n+      \'float 10.5\' => 10.5,\n+      \'float -10.5\' => -10.5,\n+      \'float 12.3456789000e10\' => 12.3456789000e10,\n+      \'float -12.3456789000e10\' => -12.3456789000e10,\n+      \'float .5\' => .5,\n+\n+      // array data\n+      \'empty array\' => array(),\n+      \'int indexed array\' => $index_array,\n+      \'associative array\' => $assoc_array,\n+      \'nested arrays\' => array(\'foo\', $index_array, $assoc_array),\n+\n+      // null data\n+      \'uppercase NULL\' => NULL,\n+      \'lowercase null\' => null,\n+\n+      // boolean data\n+      \'lowercase true\' => true,\n+      \'lowercase false\' =>false,\n+      \'uppercase TRUE\' =>TRUE,\n+      \'uppercase FALSE\' =>FALSE,\n+\n+      // empty data\n+      \'empty string DQ\' => "",\n+      \'empty string SQ\' => \'\',\n+\n+      // object data\n+      \'instance of classWithToString\' => new classWithToString(),\n+      \'instance of classWithoutToString\' => new classWithoutToString(),\n+\n+      // undefined data\n+      \'undefined var\' => @$undefined_var,\n+\n+      // unset data\n+      \'unset var\' => @$unset_var,\n+      \n+      // resource variable\n+      \'resource\' => $fp      \n+);\n+\n+// loop through each element of the array for mode\n+\n+foreach($inputs as $valueType =>$value) {\n+      echo "\\n--$valueType--\\n";\n+      var_dump( mcrypt_encrypt($cipher, $key, $data, $value, $iv) );\n+};\n+\n+fclose($fp);\n+\n+?>\n+===DONE===\n+--EXPECTF--\n+*** Testing mcrypt_encrypt() : usage variation ***\n+\n+--int 0--\n+Error: 2 - mcrypt_encrypt(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--int 1--\n+Error: 2 - mcrypt_encrypt(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--int 12345--\n+Error: 2 - mcrypt_encrypt(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--int -12345--\n+Error: 2 - mcrypt_encrypt(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--float 10.5--\n+Error: 2 - mcrypt_encrypt(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--float -10.5--\n+Error: 2 - mcrypt_encrypt(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--float 12.3456789000e10--\n+Error: 2 - mcrypt_encrypt(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--float -12.3456789000e10--\n+Error: 2 - mcrypt_encrypt(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--float .5--\n+Error: 2 - mcrypt_encrypt(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--empty array--\n+Error: 8 - Array to string conversion, %s(%d)\n+Error: 2 - mcrypt_encrypt(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--int indexed array--\n+Error: 8 - Array to string conversion, %s(%d)\n+Error: 2 - mcrypt_encrypt(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--associative array--\n+Error: 8 - Array to string conversion, %s(%d)\n+Error: 2 - mcrypt_encrypt(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--nested arrays--\n+Error: 8 - Array to string conversion, %s(%d)\n+Error: 2 - mcrypt_encrypt(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--uppercase NULL--\n+Error: 2 - mcrypt_encrypt(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--lowercase null--\n+Error: 2 - mcrypt_encrypt(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--lowercase true--\n+Error: 2 - mcrypt_encrypt(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--lowercase false--\n+Error: 2 - mcrypt_encrypt(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--uppercase TRUE--\n+Error: 2 - mcrypt_encrypt(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--uppercase FALSE--\n+Error: 2 - mcrypt_encrypt(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--empty string DQ--\n+Error: 2 - mcrypt_encrypt(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--empty string SQ--\n+Error: 2 - mcrypt_encrypt(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--instance of classWithToString--\n+Error: 2 - mcrypt_encrypt(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--instance of classWithoutToString--\n+Error: 4096 - Object of class classWithoutToString could not be converted to string, %s(%d)\n+Error: 8 - Object of class classWithoutToString to string conversion, %s(%d)\n+Error: 2 - mcrypt_encrypt(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--undefined var--\n+Error: 2 - mcrypt_encrypt(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--unset var--\n+Error: 2 - mcrypt_encrypt(): Module initialization failed, %s(%d)\n+bool(false)\n+\n+--resource--\n+Error: 2 - mcrypt_encrypt(): Module initialization failed, %s(%d)\n+bool(false)\n+===DONE===\ndiff --git a/test_phpt/ext/mcrypt/mcrypt_encrypt_variation5.phpt b/test_phpt/ext/mcrypt/mcrypt_encrypt_variation5.phpt\nnew file mode 100644\nindex 00000000..ecadb765\n--- /dev/null\n+++ b/test_phpt/ext/mcrypt/mcrypt_encrypt_variation5.phpt\n@@ -0,0 +1,231 @@\n+--TEST--\n+Test mcrypt_encrypt() function : usage variation \n+--SKIPIF--\n+<?php \n+if (!extension_loaded("mcrypt")) {\n+\tprint "skip - mcrypt extension not loaded"; \n+}\t \n+?>\n+--FILE--\n+<?php\n+/* Prototype  : string mcrypt_encrypt(string cipher, string key, string data, string mode, string iv)\n+ * Description: OFB crypt/decrypt data using key key with cipher cipher starting with iv \n+ * Source code: ext/mcrypt/mcrypt.c\n+ * Alias to functions: \n+ */\n+\n+echo "*** Testing mcrypt_encrypt() : usage variation ***\\n";\n+\n+// Define error handler\n+function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {\n+\tif (error_reporting() != 0) {\n+\t\t// report non-silenced errors\n+\t\techo "Error: $err_no - $err_msg, $filename($linenum)\\n";\n+\t}\n+}\n+set_error_handler(\'test_error_handler\');\n+\n+// Initialise function arguments not being substituted (if any)\n+$cipher = MCRYPT_TRIPLEDES;\n+$key = b\'string_val\';\n+$data = b\'string_val\';\n+//in php, it incorrectly reports problems with iv in ECB mode.\n+$mode = MCRYPT_MODE_CBC;\n+\n+//get an unset variable\n+$unset_var = 10;\n+unset ($unset_var);\n+\n+// define some classes\n+class classWithToString\n+{\n+\tpublic function __toString() {\n+\t\treturn b"Class A object";\n+\t}\n+}\n+\n+class classWithoutToString\n+{\n+}\n+\n+// heredoc string\n+$heredoc = b<<<EOT\n+hello world\n+EOT;\n+\n+// get a resource variable\n+$fp = fopen(__FILE__, "r");\n+\n+// add arrays\n+$index_array = array (1, 2, 3);\n+$assoc_array = array (\'one\' => 1, \'two\' => 2);\n+\n+//array of values to iterate over\n+$inputs = array(\n+\n+      // int data\n+      \'int 0\' => 0,\n+      \'int 1\' => 1,\n+      \'int 12345\' => 12345,\n+      \'int -12345\' => -2345,\n+\n+      // float data\n+      \'float 10.5\' => 10.5,\n+      \'float -10.5\' => -10.5,\n+      \'float 12.3456789000e10\' => 12.3456789000e10,\n+      \'float -12.3456789000e10\' => -12.3456789000e10,\n+      \'float .5\' => .5,\n+\n+      // array data\n+      \'empty array\' => array(),\n+      \'int indexed array\' => $index_array,\n+      \'associative array\' => $assoc_array,\n+      \'nested arrays\' => array(\'foo\', $index_array, $assoc_array),\n+\n+      // null data\n+      \'uppercase NULL\' => NULL,\n+      \'lowercase null\' => null,\n+\n+      // boolean data\n+      \'lowercase true\' => true,\n+      \'lowercase false\' =>false,\n+      \'uppercase TRUE\' =>TRUE,\n+      \'uppercase FALSE\' =>FALSE,\n+\n+      // empty data\n+      \'empty string DQ\' => "",\n+      \'empty string SQ\' => \'\',\n+\n+      // object data\n+      \'instance of classWithToString\' => new classWithToString(),\n+      \'instance of classWithoutToString\' => new classWithoutToString(),\n+\n+      // undefined data\n+      \'undefined var\' => @$undefined_var,\n+\n+      // unset data\n+      \'unset var\' => @$unset_var,\n+      \n+      // resource variable\n+      \'resource\' => $fp      \n+);\n+\n+// loop through each element of the array for iv\n+\n+foreach($inputs as $valueType =>$value) {\n+      echo "\\n--$valueType--\\n";\n+      var_dump( bin2hex(mcrypt_encrypt($cipher, $key, $data, $mode, $value)));\n+};\n+\n+fclose($fp);\n+\n+?>\n+===DONE===\n+--EXPECTF--\n+*** Testing mcrypt_encrypt() : usage variation ***\n+\n+--int 0--\n+Error: 2 - mcrypt_encrypt(): The IV parameter must be as long as the blocksize, %s(%d)\n+string(32) "6438db90653c4d3080c3ceab43618c05"\n+\n+--int 1--\n+Error: 2 - mcrypt_encrypt(): The IV parameter must be as long as the blocksize, %s(%d)\n+string(32) "6438db90653c4d3080c3ceab43618c05"\n+\n+--int 12345--\n+Error: 2 - mcrypt_encrypt(): The IV parameter must be as long as the blocksize, %s(%d)\n+string(32) "6438db90653c4d3080c3ceab43618c05"\n+\n+--int -12345--\n+Error: 2 - mcrypt_encrypt(): The IV parameter must be as long as the blocksize, %s(%d)\n+string(32) "6438db90653c4d3080c3ceab43618c05"\n+\n+--float 10.5--\n+Error: 2 - mcrypt_encrypt(): The IV parameter must be as long as the blocksize, %s(%d)\n+string(32) "6438db90653c4d3080c3ceab43618c05"\n+\n+--float -10.5--\n+Error: 2 - mcrypt_encrypt(): The IV parameter must be as long as the blocksize, %s(%d)\n+string(32) "6438db90653c4d3080c3ceab43618c05"\n+\n+--float 12.3456789000e10--\n+Error: 2 - mcrypt_encrypt(): The IV parameter must be as long as the blocksize, %s(%d)\n+string(32) "6438db90653c4d3080c3ceab43618c05"\n+\n+--float -12.3456789000e10--\n+Error: 2 - mcrypt_encrypt(): The IV parameter must be as long as the blocksize, %s(%d)\n+string(32) "6438db90653c4d3080c3ceab43618c05"\n+\n+--float .5--\n+Error: 2 - mcrypt_encrypt(): The IV parameter must be as long as the blocksize, %s(%d)\n+string(32) "6438db90653c4d3080c3ceab43618c05"\n+\n+--empty array--\n+Error: 2 - mcrypt_encrypt() expects parameter 5 to be string, array given, %s(%d)\n+string(0) ""\n+\n+--int indexed array--\n+Error: 2 - mcrypt_encrypt() expects parameter 5 to be string, array given, %s(%d)\n+string(0) ""\n+\n+--associative array--\n+Error: 2 - mcrypt_encrypt() expects parameter 5 to be string, array given, %s(%d)\n+string(0) ""\n+\n+--nested arrays--\n+Error: 2 - mcrypt_encrypt() expects parameter 5 to be string, array given, %s(%d)\n+string(0) ""\n+\n+--uppercase NULL--\n+Error: 2 - mcrypt_encrypt(): The IV parameter must be as long as the blocksize, %s(%d)\n+string(32) "6438db90653c4d3080c3ceab43618c05"\n+\n+--lowercase null--\n+Error: 2 - mcrypt_encrypt(): The IV parameter must be as long as the blocksize, %s(%d)\n+string(32) "6438db90653c4d3080c3ceab43618c05"\n+\n+--lowercase true--\n+Error: 2 - mcrypt_encrypt(): The IV parameter must be as long as the blocksize, %s(%d)\n+string(32) "6438db90653c4d3080c3ceab43618c05"\n+\n+--lowercase false--\n+Error: 2 - mcrypt_encrypt(): The IV parameter must be as long as the blocksize, %s(%d)\n+string(32) "6438db90653c4d3080c3ceab43618c05"\n+\n+--uppercase TRUE--\n+Error: 2 - mcrypt_encrypt(): The IV parameter must be as long as the blocksize, %s(%d)\n+string(32) "6438db90653c4d3080c3ceab43618c05"\n+\n+--uppercase FALSE--\n+Error: 2 - mcrypt_encrypt(): The IV parameter must be as long as the blocksize, %s(%d)\n+string(32) "6438db90653c4d3080c3ceab43618c05"\n+\n+--empty string DQ--\n+Error: 2 - mcrypt_encrypt(): The IV parameter must be as long as the blocksize, %s(%d)\n+string(32) "6438db90653c4d3080c3ceab43618c05"\n+\n+--empty string SQ--\n+Error: 2 - mcrypt_encrypt(): The IV parameter must be as long as the blocksize, %s(%d)\n+string(32) "6438db90653c4d3080c3ceab43618c05"\n+\n+--instance of classWithToString--\n+Error: 2 - mcrypt_encrypt(): The IV parameter must be as long as the blocksize, %s(%d)\n+string(32) "6438db90653c4d3080c3ceab43618c05"\n+\n+--instance of classWithoutToString--\n+Error: 2 - mcrypt_encrypt() expects parameter 5 to be string, object given, %s(%d)\n+string(0) ""\n+\n+--undefined var--\n+Error: 2 - mcrypt_encrypt(): The IV parameter must be as long as the blocksize, %s(%d)\n+string(32) "6438db90653c4d3080c3ceab43618c05"\n+\n+--unset var--\n+Error: 2 - mcrypt_encrypt(): The IV parameter must be as long as the blocksize, %s(%d)\n+string(32) "6438db90653c4d3080c3ceab43618c05"\n+\n+--resource--\n+Error: 2 - mcrypt_encrypt() expects parameter 5 to be string, resource given, %s(%d)\n+string(0) ""\n+===DONE===\n+\ndiff --git a/test_phpt/ext/mcrypt/mcrypt_filters.phpt b/test_phpt/ext/mcrypt/mcrypt_filters.phpt\nnew file mode 100644\nindex 00000000..f5282195\n--- /dev/null\n+++ b/test_phpt/ext/mcrypt/mcrypt_filters.phpt\n@@ -0,0 +1,41 @@\n+--TEST--\n+mcrypt filters\n+--SKIPIF--\n+<?php if (!extension_loaded("mcrypt")) print "skip"; ?>\n+--FILE--\n+<?php\n+foreach (stream_get_filters() as $f) {\n+\tif ($f == "mcrypt.*" || $f == "mdecrypt.*") {\n+\t   echo "FOUND\\n";\n+\t}\n+}\n+\n+$secretfile = \'secert-file.tmp\';\n+$passphrase = \'My secret\';\n+\n+$iv = substr(md5(\'iv\'.$passphrase, true), 0, 8);\n+$key = substr(md5(\'pass1\'.$passphrase, true) . \n+               md5(\'pass2\'.$passphrase, true), 0, 24);\n+$opts = array(\'iv\'=>$iv, \'key\'=>$key);\n+\n+$fp = fopen($secretfile, \'wb\');\n+stream_filter_append($fp, \'mcrypt.tripledes\', STREAM_FILTER_WRITE, $opts);\n+fwrite($fp, \'Secret secret secret data\');\n+fclose($fp);\n+\n+echo md5_file($secretfile)."\\n";\n+\n+$fp = fopen($secretfile, \'rb\');\n+stream_filter_append($fp, \'mdecrypt.tripledes\', STREAM_FILTER_READ, $opts);\n+$data = stream_get_contents($fp);\n+fclose($fp);\n+\n+echo $data."\\n";\n+\n+@unlink($secretfile);\n+\n+--EXPECTF--\n+FOUND\n+FOUND\n+32e14bd3c31f2bd666e4290ebdb166a7\n+Secret secret secret data\n\\ No newline at end of file\ndiff --git a/test_phpt/ext/mcrypt/mcrypt_get_block_size.phpt b/test_phpt/ext/mcrypt/mcrypt_get_block_size.phpt\nnew file mode 100644\nindex 00000000..bf1f24df\n--- /dev/null\n+++ b/test_phpt/ext/mcrypt/mcrypt_get_block_size.phpt\n@@ -0,0 +1,13 @@\n+--TEST--\n+mcrypt_get_block_size\n+--SKIPIF--\n+<?php if (!extension_loaded("mcrypt")) print "skip"; ?>\n+--FILE--\n+<?php\n+var_dump(mcrypt_get_block_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_CBC));\n+var_dump(mcrypt_get_block_size(MCRYPT_3DES, MCRYPT_MODE_CBC));\n+var_dump(mcrypt_get_block_size(MCRYPT_WAKE, MCRYPT_MODE_STREAM));\n+--EXPECT--\n+int(32)\n+int(8)\n+int(1)\ndiff --git a/test_phpt/ext/mcrypt/mcrypt_get_cipher_name.phpt b/test_phpt/ext/mcrypt/mcrypt_get_cipher_name.phpt\nnew file mode 100644\nindex 00000000..9d4961ae\n--- /dev/null\n+++ b/test_phpt/ext/mcrypt/mcrypt_get_cipher_name.phpt\n@@ -0,0 +1,15 @@\n+--TEST--\n+mcrypt_get_cipher_name\n+--SKIPIF--\n+<?php if (!extension_loaded("mcrypt")) print "skip"; ?>\n+--FILE--\n+<?php\n+echo mcrypt_get_cipher_name(MCRYPT_RIJNDAEL_256) . "\\n";\n+echo mcrypt_get_cipher_name(MCRYPT_RC2) . "\\n";\n+echo mcrypt_get_cipher_name(MCRYPT_ARCFOUR) . "\\n";\n+echo mcrypt_get_cipher_name(MCRYPT_WAKE) . "\\n";\n+--EXPECT--\n+Rijndael-256\n+RC2\n+RC4\n+WAKE\ndiff --git a/test_phpt/ext/mcrypt/mcrypt_get_iv_size.phpt b/test_phpt/ext/mcrypt/mcrypt_get_iv_size.phpt\nnew file mode 100644\nindex 00000000..ad359974\n--- /dev/null\n+++ b/test_phpt/ext/mcrypt/mcrypt_get_iv_size.phpt\n@@ -0,0 +1,17 @@\n+--TEST--\n+mcrypt_enc_get_iv_size\n+--SKIPIF--\n+<?php if (!extension_loaded("mcrypt")) print "skip"; ?>\n+--FILE--\n+<?php\n+var_dump(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_CBC));\n+var_dump(mcrypt_get_iv_size(MCRYPT_3DES, MCRYPT_MODE_CBC));\n+var_dump(mcrypt_get_iv_size(MCRYPT_WAKE, MCRYPT_MODE_STREAM));\n+var_dump(mcrypt_get_iv_size(MCRYPT_XTEA, MCRYPT_MODE_STREAM));\n+--EXPECTF--\n+int(32)\n+int(8)\n+int(0)\n+\n+Warning: mcrypt_get_iv_size(): Module initialization failed in %s on line %d\n+bool(false)\n\\ No newline at end of file\ndiff --git a/test_phpt/ext/mcrypt/mcrypt_get_key_size.phpt b/test_phpt/ext/mcrypt/mcrypt_get_key_size.phpt\nnew file mode 100644\nindex 00000000..930cf4d6\n--- /dev/null\n+++ b/test_phpt/ext/mcrypt/mcrypt_get_key_size.phpt\n@@ -0,0 +1,13 @@\n+--TEST--\n+mcrypt_get_key_size\n+--SKIPIF--\n+<?php if (!extension_loaded("mcrypt")) print "skip"; ?>\n+--FILE--\n+<?php\n+var_dump(mcrypt_get_key_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_CBC));\n+var_dump(mcrypt_get_key_size(MCRYPT_3DES, MCRYPT_MODE_CBC));\n+var_dump(mcrypt_get_key_size(MCRYPT_WAKE, MCRYPT_MODE_STREAM));\n+--EXPECT--\n+int(32)\n+int(24)\n+int(32)\ndiff --git a/test_phpt/ext/mcrypt/mcrypt_list_algorithms.phpt b/test_phpt/ext/mcrypt/mcrypt_list_algorithms.phpt\nnew file mode 100644\nindex 00000000..9baf9a64\n--- /dev/null\n+++ b/test_phpt/ext/mcrypt/mcrypt_list_algorithms.phpt\n@@ -0,0 +1,16 @@\n+--TEST--\n+mcrypt_list_algorithms\n+--SKIPIF--\n+<?php if (!extension_loaded("mcrypt")) print "skip"; ?>\n+--FILE--\n+<?php\n+foreach (mcrypt_list_algorithms() as $algo) {\n+\tif (in_array($algo, array(\'rijndael-256\', \'des\', \'blowfish\', \'twofish\'))) {\n+\t   echo "FOUND\\n";\n+\t}\n+}\n+--EXPECT--\n+FOUND\n+FOUND\n+FOUND\n+FOUND\n\\ No newline at end of file\ndiff --git a/test_phpt/ext/mcrypt/mcrypt_list_modes.phpt b/test_phpt/ext/mcrypt/mcrypt_list_modes.phpt\nnew file mode 100644\nindex 00000000..0e5a6ae8\n--- /dev/null\n+++ b/test_phpt/ext/mcrypt/mcrypt_list_modes.phpt\n@@ -0,0 +1,26 @@\n+--TEST--\n+mcrypt_list_modes\n+--SKIPIF--\n+<?php if (!extension_loaded("mcrypt")) print "skip"; ?>\n+--FILE--\n+<?php\n+var_dump(mcrypt_list_modes());\n+--EXPECT--\n+array(8) {\n+  [0]=>\n+  string(3) "cbc"\n+  [1]=>\n+  string(3) "cfb"\n+  [2]=>\n+  string(3) "ctr"\n+  [3]=>\n+  string(3) "ecb"\n+  [4]=>\n+  string(4) "ncfb"\n+  [5]=>\n+  string(4) "nofb"\n+  [6]=>\n+  string(3) "ofb"\n+  [7]=>\n+  string(6) "stream"\n+}\n\\ No newline at end of file\ndiff --git a/test_phpt/ext/mcrypt/mcrypt_module_get_algo_block_size.phpt b/test_phpt/ext/mcrypt/mcrypt_module_get_algo_block_size.phpt\nnew file mode 100644\nindex 00000000..c89a44ad\n--- /dev/null\n+++ b/test_phpt/ext/mcrypt/mcrypt_module_get_algo_block_size.phpt\n@@ -0,0 +1,19 @@\n+--TEST--\n+mcrypt_module_get_algo_block_size\n+--SKIPIF--\n+<?php if (!extension_loaded("mcrypt")) print "skip"; ?>\n+--FILE--\n+<?php\n+var_dump(mcrypt_module_get_algo_block_size(MCRYPT_RIJNDAEL_256));\n+var_dump(mcrypt_module_get_algo_block_size(MCRYPT_RIJNDAEL_192));\n+var_dump(mcrypt_module_get_algo_block_size(MCRYPT_RC2));\n+var_dump(mcrypt_module_get_algo_block_size(MCRYPT_XTEA));\n+var_dump(mcrypt_module_get_algo_block_size(MCRYPT_CAST_128));\n+var_dump(mcrypt_module_get_algo_block_size(MCRYPT_BLOWFISH));\n+--EXPECT--\n+int(32)\n+int(24)\n+int(8)\n+int(8)\n+int(8)\n+int(8)\ndiff --git a/test_phpt/ext/mcrypt/mcrypt_module_get_algo_key_size.phpt b/test_phpt/ext/mcrypt/mcrypt_module_get_algo_key_size.phpt\nnew file mode 100644\nindex 00000000..7d3841f3\n--- /dev/null\n+++ b/test_phpt/ext/mcrypt/mcrypt_module_get_algo_key_size.phpt\n@@ -0,0 +1,19 @@\n+--TEST--\n+mcrypt_module_get_algo_key_size\n+--SKIPIF--\n+<?php if (!extension_loaded("mcrypt")) print "skip"; ?>\n+--FILE--\n+<?php\n+var_dump(mcrypt_module_get_algo_key_size(MCRYPT_RIJNDAEL_256));\n+var_dump(mcrypt_module_get_algo_key_size(MCRYPT_RIJNDAEL_192));\n+var_dump(mcrypt_module_get_algo_key_size(MCRYPT_RC2));\n+var_dump(mcrypt_module_get_algo_key_size(MCRYPT_XTEA));\n+var_dump(mcrypt_module_get_algo_key_size(MCRYPT_CAST_128));\n+var_dump(mcrypt_module_get_algo_key_size(MCRYPT_BLOWFISH));\n+--EXPECT--\n+int(32)\n+int(32)\n+int(128)\n+int(16)\n+int(16)\n+int(56)\ndiff --git a/test_phpt/ext/mcrypt/mcrypt_module_get_supported_key_sizes.phpt b/test_phpt/ext/mcrypt/mcrypt_module_get_supported_key_sizes.phpt\nnew file mode 100644\nindex 00000000..bf45bb48\n--- /dev/null\n+++ b/test_phpt/ext/mcrypt/mcrypt_module_get_supported_key_sizes.phpt\n@@ -0,0 +1,19 @@\n+--TEST--\n+mcrypt_module_get_supported_key_sizes\n+--SKIPIF--\n+<?php if (!extension_loaded("mcrypt")) print "skip"; ?>\n+--FILE--\n+<?php\n+var_dump(mcrypt_module_get_supported_key_sizes(MCRYPT_RIJNDAEL_256));\n+var_dump(mcrypt_module_get_supported_key_sizes(MCRYPT_RC2));\n+--EXPECT--\n+array(3) {\n+  [0]=>\n+  int(16)\n+  [1]=>\n+  int(24)\n+  [2]=>\n+  int(32)\n+}\n+array(0) {\n+}\n\\ No newline at end of file\ndiff --git a/test_phpt/ext/mcrypt/mcrypt_module_is_block_algorithm.phpt b/test_phpt/ext/mcrypt/mcrypt_module_is_block_algorithm.phpt\nnew file mode 100644\nindex 00000000..2cfc87dd\n--- /dev/null\n+++ b/test_phpt/ext/mcrypt/mcrypt_module_is_block_algorithm.phpt\n@@ -0,0 +1,15 @@\n+--TEST--\n+mcrypt_module_is_block_algorithm\n+--SKIPIF--\n+<?php if (!extension_loaded("mcrypt")) print "skip"; ?>\n+--FILE--\n+<?php\n+var_dump(mcrypt_module_is_block_algorithm(MCRYPT_RIJNDAEL_128));\n+var_dump(mcrypt_module_is_block_algorithm(MCRYPT_DES));\n+var_dump(mcrypt_module_is_block_algorithm(MCRYPT_WAKE));\n+var_dump(mcrypt_module_is_block_algorithm(MCRYPT_XTEA));\n+--EXPECT--\n+bool(true)\n+bool(true)\n+bool(false)\n+bool(true)\n\\ No newline at end of file\ndiff --git a/test_phpt/ext/mcrypt/mcrypt_module_is_block_algorithm_mode.phpt b/test_phpt/ext/mcrypt/mcrypt_module_is_block_algorithm_mode.phpt\nnew file mode 100644\nindex 00000000..29245514\n--- /dev/null\n+++ b/test_phpt/ext/mcrypt/mcrypt_module_is_block_algorithm_mode.phpt\n@@ -0,0 +1,15 @@\n+--TEST--\n+mcrypt_module_is_block_algorithm_mode\n+--SKIPIF--\n+<?php if (!extension_loaded("mcrypt")) print "skip"; ?>\n+--FILE--\n+<?php\n+var_dump(mcrypt_module_is_block_algorithm_mode(MCRYPT_MODE_CBC));\n+var_dump(mcrypt_module_is_block_algorithm_mode(MCRYPT_MODE_ECB));\n+var_dump(mcrypt_module_is_block_algorithm_mode(MCRYPT_MODE_STREAM));\n+var_dump(mcrypt_module_is_block_algorithm_mode(MCRYPT_MODE_OFB));\n+--EXPECT--\n+bool(true)\n+bool(true)\n+bool(false)\n+bool(true)\n\\ No newline at end of file\ndiff --git a/test_phpt/ext/mcrypt/mcrypt_module_is_block_mode.phpt b/test_phpt/ext/mcrypt/mcrypt_module_is_block_mode.phpt\nnew file mode 100644\nindex 00000000..662279f5\n--- /dev/null\n+++ b/test_phpt/ext/mcrypt/mcrypt_module_is_block_mode.phpt\n@@ -0,0 +1,17 @@\n+--TEST--\n+mcrypt_module_is_block_mode\n+--SKIPIF--\n+<?php if (!extension_loaded("mcrypt")) print "skip"; ?>\n+--FILE--\n+<?php\n+var_dump(mcrypt_module_is_block_mode(MCRYPT_MODE_CBC));\n+var_dump(mcrypt_module_is_block_mode(MCRYPT_MODE_ECB));\n+var_dump(mcrypt_module_is_block_mode(MCRYPT_MODE_STREAM));\n+var_dump(mcrypt_module_is_block_mode(MCRYPT_MODE_NOFB));\n+var_dump(mcrypt_module_is_block_mode(MCRYPT_MODE_OFB));\n+--EXPECT--\n+bool(true)\n+bool(true)\n+bool(false)\n+bool(false)\n+bool(false)\n\\ No newline at end of file\ndiff --git a/test_phpt/ext/mcrypt/mcrypt_module_open.phpt b/test_phpt/ext/mcrypt/mcrypt_module_open.phpt\nnew file mode 100644\nindex 00000000..92f0d555\n--- /dev/null\n+++ b/test_phpt/ext/mcrypt/mcrypt_module_open.phpt\n@@ -0,0 +1,14 @@\n+--TEST--\n+mcrypt_module_open\n+--SKIPIF--\n+<?php if (!extension_loaded("mcrypt")) print "skip"; ?>\n+--FILE--\n+<?php\n+var_dump(mcrypt_module_open(MCRYPT_RIJNDAEL_256, \'\', MCRYPT_MODE_CBC, \'\'));\n+mcrypt_module_open(\'\', \'\', \'\', \'\');\n+\n+--EXPECTF--\n+resource(%d) of type (mcrypt)\n+\n+Warning: mcrypt_module_open(): Could not open encryption module in %s on line %d\n+\ndiff --git a/test_phpt/ext/mcrypt/mcrypt_module_self_test.phpt b/test_phpt/ext/mcrypt/mcrypt_module_self_test.phpt\nnew file mode 100644\nindex 00000000..cf07bfe6\n--- /dev/null\n+++ b/test_phpt/ext/mcrypt/mcrypt_module_self_test.phpt\n@@ -0,0 +1,13 @@\n+--TEST--\n+mcrypt_module_self_test\n+--SKIPIF--\n+<?php if (!extension_loaded("mcrypt")) print "skip"; ?>\n+--FILE--\n+<?php\n+var_dump(mcrypt_module_self_test(MCRYPT_RIJNDAEL_128));\n+var_dump(mcrypt_module_self_test(MCRYPT_RC2));\n+var_dump(mcrypt_module_self_test(\'\'));\n+--EXPECT--\n+bool(true)\n+bool(true)\n+bool(false)\ndiff --git a/test_phpt/ext/mcrypt/mcrypt_ofb.phpt b/test_phpt/ext/mcrypt/mcrypt_ofb.phpt\nnew file mode 100644\nindex 00000000..1532c4cf\n--- /dev/null\n+++ b/test_phpt/ext/mcrypt/mcrypt_ofb.phpt\n@@ -0,0 +1,21 @@\n+--TEST--\n+mcrypt_ofb\n+--SKIPIF--\n+<?php if (!extension_loaded("mcrypt")) print "skip"; ?>\n+--FILE--\n+<?php\n+$key      = "FooBar";\n+$secret   = "PHP Testfest 2008";\n+$cipher   = MCRYPT_RIJNDAEL_128;\n+\n+$iv       = mcrypt_create_iv(mcrypt_get_iv_size($cipher, MCRYPT_MODE_ECB), MCRYPT_RAND);\n+$enc_data = mcrypt_ofb($cipher, $key, $secret, MCRYPT_ENCRYPT, $iv);\n+\n+// we have to trim as AES rounds the blocks and decrypt doesnt detect that\n+echo trim(mcrypt_ofb($cipher, $key, $enc_data, MCRYPT_DECRYPT, $iv)) . "\\n";\n+\n+// a warning must be issued if we don\'t use a IV on a AES cipher, that usually requires an IV\n+mcrypt_ofb($cipher, $key, $enc_data, MCRYPT_DECRYPT, $iv);\n+\n+--EXPECT--\n+PHP Testfest 2008\n\\ No newline at end of file\ndiff --git a/test_phpt/ext/mcrypt/mcrypt_rijndael128_128BitKey.phpt b/test_phpt/ext/mcrypt/mcrypt_rijndael128_128BitKey.phpt\nnew file mode 100644\nindex 00000000..100352a1\n--- /dev/null\n+++ b/test_phpt/ext/mcrypt/mcrypt_rijndael128_128BitKey.phpt\n@@ -0,0 +1,130 @@\n+--TEST--\n+Test mcrypt_encrypt() function : TripleDES functionality \n+--SKIPIF--\n+<?php \n+if (!extension_loaded("mcrypt")) {\n+\tprint "skip - mcrypt extension not loaded"; \n+}\t \n+?>\n+--FILE--\n+<?php\n+/* Prototype  : string mcrypt_encrypt(string cipher, string key, string data, string mode, string iv)\n+ * Description: OFB crypt/decrypt data using key key with cipher cipher starting with iv \n+ * Source code: ext/mcrypt/mcrypt.c\n+ * Alias to functions: \n+ */\n+ /* Prototype  : string mcrypt_decrypt(string cipher, string key, string data, string mode, string iv)\n+ * Description: OFB crypt/decrypt data using key key with cipher cipher starting with iv \n+ * Source code: ext/mcrypt/mcrypt.c\n+ * Alias to functions: \n+ */\n+ /* Prototype  : string mcrypt_cbc(int cipher, string key, string data, int mode, string iv)\n+ * Description: CBC crypt/decrypt data using key key with cipher cipher starting with iv \n+ * Source code: ext/mcrypt/mcrypt.c\n+ * Alias to functions: \n+ */\n+\n+echo "*** Testing mcrypt : Rijndael128 functionality ***\\n";\n+\n+$cipher = MCRYPT_RIJNDAEL_128;\n+$mode = MCRYPT_MODE_CBC;\n+$data = b\'This is the secret message which must be encrypted\';\n+\n+// keys upto 128 bits (16 bytes)\n+$keys = array(\n+   null, \n+   \'\', \n+   b\'12345678\', \n+   b\'1234567890123456\'\n+);\n+// rijndael128 is a block cipher of 128 bits (16 bytes)\n+$ivs = array(\n+   null, \n+   \'\', \n+   b\'12345678\', \n+   b\'1234567890123456\', \n+   b\'12345678901234567\'\n+);\n+\n+\n+$iv = b\'1234567890123456\';\n+echo "\\n--- testing different key lengths\\n";\n+foreach ($keys as $key) {\n+   echo "\\nkey length=".strlen($key)."\\n";\n+   $res = mcrypt_encrypt($cipher, $key, $data, MCRYPT_MODE_CBC, $iv);\n+   var_dump(bin2hex($res));\n+   $res = mcrypt_cbc($cipher, $key, $res, MCRYPT_DECRYPT, $iv);\n+   var_dump(bin2hex($res));   \n+}\n+\n+$key = b\'1234567890123456\';  \n+echo "\\n--- testing different iv lengths\\n";\n+foreach ($ivs as $iv) {\n+   echo "\\niv length=".strlen($iv)."\\n";\n+   $res = mcrypt_cbc($cipher, $key, $data, $mode, $iv);\n+   var_dump(bin2hex($res));\n+   $res = mcrypt_decrypt($cipher, $key, $res, MCRYPT_MODE_CBC, $iv);\n+   var_dump(bin2hex($res));   \n+}\n+\n+?>\n+===DONE===\n+--EXPECTF--\n+*** Testing mcrypt : Rijndael128 functionality ***\n+\n+--- testing different key lengths\n+\n+key length=0\n+string(128) "4fbf24aaa789f5194260ade1acd9499402c1845cc517e8fe43cfb5b90a0df294db33ecd1a836c47d6bf6d8600512ba415e17008a1e1991f81056258d82099397"\n+string(128) "546869732069732074686520736563726574206d657373616765207768696368206d75737420626520656e637279707465640000000000000000000000000000"\n+\n+key length=0\n+string(128) "4fbf24aaa789f5194260ade1acd9499402c1845cc517e8fe43cfb5b90a0df294db33ecd1a836c47d6bf6d8600512ba415e17008a1e1991f81056258d82099397"\n+string(128) "546869732069732074686520736563726574206d657373616765207768696368206d75737420626520656e637279707465640000000000000000000000000000"\n+\n+key length=8\n+string(128) "d6a3042b278fa5816dc6f46152acbe5fd7d1813c3808c27cd969d8e10a64d0238724edfda0322f4512308f22d142df0e92bed861c2b732f7650e234df59183dc"\n+string(128) "546869732069732074686520736563726574206d657373616765207768696368206d75737420626520656e637279707465640000000000000000000000000000"\n+\n+key length=16\n+string(128) "dc8f957ec530acf10cd95ba7da7b6405380fe19a2941e9a8de54680512f18491bc374e5464885ae6c2ae2aa7a6cdd2fbe12a06bbc4bd59dbbfaa15f09044f101"\n+string(128) "546869732069732074686520736563726574206d657373616765207768696368206d75737420626520656e637279707465640000000000000000000000000000"\n+\n+--- testing different iv lengths\n+\n+iv length=0\n+\n+Warning: mcrypt_cbc(): The IV parameter must be as long as the blocksize in %s on line %d\n+string(128) "c082b3fabaae4c8c410eb8dba64bae10e48d79b5241fb8f24462cad43bd0b35ad2746b00817e9dcbc636b44df0ec60b46a57e7a310a308a0947724e3817a13b4"\n+\n+Warning: mcrypt_decrypt(): The IV parameter must be as long as the blocksize in %s on line %d\n+string(128) "546869732069732074686520736563726574206d657373616765207768696368206d75737420626520656e637279707465640000000000000000000000000000"\n+\n+iv length=0\n+\n+Warning: mcrypt_cbc(): The IV parameter must be as long as the blocksize in %s on line %d\n+string(128) "c082b3fabaae4c8c410eb8dba64bae10e48d79b5241fb8f24462cad43bd0b35ad2746b00817e9dcbc636b44df0ec60b46a57e7a310a308a0947724e3817a13b4"\n+\n+Warning: mcrypt_decrypt(): The IV parameter must be as long as the blocksize in %s on line %d\n+string(128) "546869732069732074686520736563726574206d657373616765207768696368206d75737420626520656e637279707465640000000000000000000000000000"\n+\n+iv length=8\n+\n+Warning: mcrypt_cbc(): The IV parameter must be as long as the blocksize in %s on line %d\n+string(128) "c082b3fabaae4c8c410eb8dba64bae10e48d79b5241fb8f24462cad43bd0b35ad2746b00817e9dcbc636b44df0ec60b46a57e7a310a308a0947724e3817a13b4"\n+\n+Warning: mcrypt_decrypt(): The IV parameter must be as long as the blocksize in %s on line %d\n+string(128) "546869732069732074686520736563726574206d657373616765207768696368206d75737420626520656e637279707465640000000000000000000000000000"\n+\n+iv length=16\n+string(128) "dc8f957ec530acf10cd95ba7da7b6405380fe19a2941e9a8de54680512f18491bc374e5464885ae6c2ae2aa7a6cdd2fbe12a06bbc4bd59dbbfaa15f09044f101"\n+string(128) "546869732069732074686520736563726574206d657373616765207768696368206d75737420626520656e637279707465640000000000000000000000000000"\n+\n+iv length=17\n+\n+Warning: mcrypt_cbc(): The IV parameter must be as long as the blocksize in %s on line %d\n+string(128) "c082b3fabaae4c8c410eb8dba64bae10e48d79b5241fb8f24462cad43bd0b35ad2746b00817e9dcbc636b44df0ec60b46a57e7a310a308a0947724e3817a13b4"\n+\n+Warning: mcrypt_decrypt(): The IV parameter must be as long as the blocksize in %s on line %d\n+string(128) "546869732069732074686520736563726574206d657373616765207768696368206d75737420626520656e637279707465640000000000000000000000000000"\n+===DONE===\n\\ No newline at end of file\ndiff --git a/test_phpt/ext/mcrypt/mcrypt_rijndael128_256BitKey.phpt b/test_phpt/ext/mcrypt/mcrypt_rijndael128_256BitKey.phpt\nnew file mode 100644\nindex 00000000..f69d3692\n--- /dev/null\n+++ b/test_phpt/ext/mcrypt/mcrypt_rijndael128_256BitKey.phpt\n@@ -0,0 +1,87 @@\n+--TEST--\n+Test mcrypt_encrypt() function : TripleDES functionality \n+--SKIPIF--\n+<?php \n+if (!extension_loaded("mcrypt")) {\n+\tprint "skip - mcrypt extension not loaded"; \n+}\t \n+?>\n+--FILE--\n+<?php\n+/* Prototype  : string mcrypt_encrypt(string cipher, string key, string data, string mode, string iv)\n+ * Description: OFB crypt/decrypt data using key key with cipher cipher starting with iv \n+ * Source code: ext/mcrypt/mcrypt.c\n+ * Alias to functions: \n+ */\n+ /* Prototype  : string mcrypt_decrypt(string cipher, string key, string data, string mode, string iv)\n+ * Description: OFB crypt/decrypt data using key key with cipher cipher starting with iv \n+ * Source code: ext/mcrypt/mcrypt.c\n+ * Alias to functions: \n+ */\n+ /* Prototype  : string mcrypt_cbc(int cipher, string key, string data, int mode, string iv)\n+ * Description: CBC crypt/decrypt data using key key with cipher cipher starting with iv \n+ * Source code: ext/mcrypt/mcrypt.c\n+ * Alias to functions: \n+ */\n+ /* Prototype  : string mcrypt_ecb(int cipher, string key, string data, int mode, string iv)\n+ * Description: ECB crypt/decrypt data using key key with cipher cipher starting with iv \n+ * Source code: ext/mcrypt/mcrypt.c\n+ * Alias to functions: \n+ */\n+\n+echo "*** Testing mcrypt : Rijndael128 functionality ***\\n";\n+\n+$cipher = MCRYPT_RIJNDAEL_128;\n+$mode = MCRYPT_MODE_CBC;\n+$data = b\'This is the secret message which must be encrypted\';\n+\n+// keys : 20 bytes, 24 bytes, 30 Bytes, 32 Bytes, 40 Bytes\n+$keys = array(\n+              b\'12345678901234567890\', \n+              b\'123456789012345678901234\', \n+              b\'123456789012345678901234567890\',\n+              b\'12345678901234567890123456789012\',\n+              b\'1234567890123456789012345678901234567890\'\n+ );\n+// rijndael128 is a block cipher of 128 bits (16 bytes)\n+$iv = b\'1234567890123456\';\n+\n+echo "\\n--- testing different key lengths\\n";\n+foreach ($keys as $key) {\n+   echo "\\nkey length=".strlen($key)."\\n";\n+   $res = mcrypt_encrypt($cipher, $key, $data, MCRYPT_MODE_CBC, $iv);\n+   var_dump(bin2hex($res));\n+   $res = mcrypt_decrypt($cipher, $key, $res, MCRYPT_MODE_CBC, $iv);\n+   var_dump(bin2hex($res));   \n+}\n+?>\n+===DONE===\n+--EXPECTF--\n+*** Testing mcrypt : Rijndael128 functionality ***\n+\n+--- testing different key lengths\n+\n+key length=20\n+string(128) "6369830bfc89a39c9981c9a40e349e3bbc8599c28d7ffbd7a330a67690dac6dfb76a55814e95c83cced68eb1544cdd8406d272c249bd0a60fa5b605d4aefbaa0"\n+string(128) "546869732069732074686520736563726574206d657373616765207768696368206d75737420626520656e637279707465640000000000000000000000000000"\n+\n+key length=24\n+string(128) "8ecdf1ed5742aff16ef34c819c8d22c707c54f4d9ffc18e5f6ab79fe68c25705351e2c001a0b9f29e5def67570ca9da644efb69a8bb97940cb4bec094dae8bb5"\n+string(128) "546869732069732074686520736563726574206d657373616765207768696368206d75737420626520656e637279707465640000000000000000000000000000"\n+\n+key length=30\n+string(128) "f7731f0c0ab22270b2f516c7837256ed731ba6658ca8f78cda2ab1588e204f990843719ae88474f6572711674fcda9f40d99155e4cc4f5a31aa461ad36a7871d"\n+string(128) "546869732069732074686520736563726574206d657373616765207768696368206d75737420626520656e637279707465640000000000000000000000000000"\n+\n+key length=32\n+string(128) "f23bc103bfd0859a8318acee6d96e5f43dff68f3cdeae817a1e77c33492e32bdb82c5f660fcd1a2bfda70d9de4d5d8028ce179a9e2f7f9ee7dd61c7b4b409e95"\n+string(128) "546869732069732074686520736563726574206d657373616765207768696368206d75737420626520656e637279707465640000000000000000000000000000"\n+\n+key length=40\n+\n+Warning: mcrypt_encrypt(): Size of key is too large for this algorithm in %s on line %d\n+string(128) "f23bc103bfd0859a8318acee6d96e5f43dff68f3cdeae817a1e77c33492e32bdb82c5f660fcd1a2bfda70d9de4d5d8028ce179a9e2f7f9ee7dd61c7b4b409e95"\n+\n+Warning: mcrypt_decrypt(): Size of key is too large for this algorithm in %s on line %d\n+string(128) "546869732069732074686520736563726574206d657373616765207768696368206d75737420626520656e637279707465640000000000000000000000000000"\n+===DONE===\n\\ No newline at end of file\ndiff --git a/test_phpt/ext/mcrypt/vectors.txt b/test_phpt/ext/mcrypt/vectors.txt\nnew file mode 100644\nindex 00000000..3624ed6d\n--- /dev/null\n+++ b/test_phpt/ext/mcrypt/vectors.txt\n@@ -0,0 +1,33 @@\n+0000000000000000        0000000000000000        4EF997456198DD78\n+FFFFFFFFFFFFFFFF        FFFFFFFFFFFFFFFF        51866FD5B85ECB8A\n+3000000000000000        1000000000000001        7D856F9A613063F2\n+1111111111111111        1111111111111111        2466DD878B963C9D\n+0123456789ABCDEF        1111111111111111        61F9C3802281B096\n+1111111111111111        0123456789ABCDEF        7D0CC630AFDA1EC7\n+FEDCBA9876543210        0123456789ABCDEF        0ACEAB0FC6A0A28D\n+7CA110454A1A6E57        01A1D6D039776742        59C68245EB05282B\n+0131D9619DC1376E        5CD54CA83DEF57DA        B1B8CC0B250F09A0\n+07A1133E4A0B2686        0248D43806F67172        1730E5778BEA1DA4\n+3849674C2602319E        51454B582DDF440A        A25E7856CF2651EB\n+04B915BA43FEB5B6        42FD443059577FA2        353882B109CE8F1A\n+0113B970FD34F2CE        059B5E0851CF143A        48F4D0884C379918\n+0170F175468FB5E6        0756D8E0774761D2        432193B78951FC98\n+43297FAD38E373FE        762514B829BF486A        13F04154D69D1AE5\n+07A7137045DA2A16        3BDD119049372802        2EEDDA93FFD39C79\n+04689104C2FD3B2F        26955F6835AF609A        D887E0393C2DA6E3\n+37D06BB516CB7546        164D5E404F275232        5F99D04F5B163969\n+1F08260D1AC2465E        6B056E18759F5CCA        4A057A3B24D3977B\n+584023641ABA6176        004BD6EF09176062        452031C1E4FADA8E\n+025816164629B007        480D39006EE762F2        7555AE39F59B87BD\n+49793EBC79B3258F        437540C8698F3CFA        53C55F9CB49FC019\n+4FB05E1515AB73A7        072D43A077075292        7A8E7BFA937E89A3\n+49E95D6D4CA229BF        02FE55778117F12A        CF9C5D7A4986ADB5\n+018310DC409B26D6        1D9D5C5018F728C2        D1ABB290658BC778\n+1C587F1C13924FEF        305532286D6F295A        55CB3774D13EF201\n+0101010101010101        0123456789ABCDEF        FA34EC4847B268B2\n+1F1F1F1F0E0E0E0E        0123456789ABCDEF        A790795108EA3CAE\n+E0FEE0FEF1FEF1FE        0123456789ABCDEF        C39E072D9FAC631D\n+0000000000000000        FFFFFFFFFFFFFFFF        014933E0CDAFF6E4\n+FFFFFFFFFFFFFFFF        0000000000000000        F21E9A77B71C49BC\n+0123456789ABCDEF        0000000000000000        245946885754369A\n+FEDCBA9876543210        FFFFFFFFFFFFFFFF        6B5C5A9C5D9E0A5A\ndiff --git a/testing/test_fileops.py b/testing/test_fileops.py\nindex 267173b4..4e23230f 100644\n--- a/testing/test_fileops.py\n+++ b/testing/test_fileops.py\n@@ -123,6 +123,26 @@ class TestFileOps(BaseTestInterpreter):\n             \'\'\')\n         assert output == []\n \n+    def test_require_path(self, tmpdir):\n+        on_path = tmpdir.mkdir(\'on_path\')\n+        on_path.join(\'a.php\').write(\'\'\'<?php\n+        return \'on_path\';\n+        \'\'\')\n+        some_dir = tmpdir.mkdir(\'some_dir\')\n+        some_dir.join(\'a.php\').write(\'\'\'<?php\n+        return \'some_dir\';\n+        \'\'\')\n+        output = self.run("""\n+        set_include_path(\'%s\');\n+        chdir(\'%s\');\n+        $dir = include \'a.php\'; // uses include_path\n+        echo $dir;\n+        $dir = include \'./a.php\'; // relative to CWD\n+        echo $dir;\n+        """ % (on_path, some_dir))\n+        assert map(self.space.str_w, output) == [\'on_path\', \'some_dir\']\n+\n+\n     def test_require_once(self, tmpdir):\n         f = tmpdir.join(\'x.php\')\n         f.write(\'\'\'<?php\n@@ -138,20 +158,41 @@ class TestFileOps(BaseTestInterpreter):\n         \'\'\' % locals())\n         assert map(self.space.int_w, output) == [6, 6, 1, 6]\n \n-    def test_require_once_normalisation(self, tmpdir):\n-        a = tmpdir.join(\'a.php\')\n-        b = tmpdir.join(\'b.php\')\n+    def test_require_normalisation_1(self, tmpdir):\n         subdir = tmpdir.mkdir(\'subdir\')\n+        a = subdir.join(\'a.php\')\n+        b = subdir.join(\'b.php\')\n         a.write(\'\'\'<?php\n-        require_once \'../b.php\';\n+        require_once \'../subdir/b.php\';\n         function foo() {}\n         ?>\'\'\')\n         b.write(\'\'\'<?php\n-        require_once \'../a.php\';\n+        require_once \'../subdir/a.php\';\n         ?>\'\'\')\n         output = self.run("chdir(\'%s\'); require_once \'%s\';" % (subdir, a))\n         assert output == []\n \n+    def test_require_normalisation_2(self, tmpdir):\n+        dir1 = tmpdir.mkdir(\'dir1\')\n+        a1 = dir1.join(\'a.php\')\n+        dir2 = tmpdir.mkdir(\'dir2\')\n+        a2 = dir2.join(\'a.php\')\n+        a1.write(\'\'\'<?php\n+        return \'in dir1\';\n+        ?>\'\'\')\n+        a2.write(\'\'\'<?php\n+        return \'in dir2\';\n+        ?>\'\'\')\n+        output = self.run(\'\'\'\n+        chdir(\'%s\');\n+        $a = require_once \'a.php\';\n+        echo $a;\n+        chdir(\'%s\');\n+        $a = require_once \'a.php\';\n+        echo $a;\n+        \'\'\' % (dir1, dir2))\n+        assert map(self.space.str_w, output) == [\'in dir1\', \'in dir2\']\n+\n     def test_include(self, tmpdir):\n         f = tmpdir.join(\'x.php\')\n         f.write(\'\'\'<?php\ndiff --git a/testing/test_interpreter.py b/testing/test_interpreter.py\nindex 7c0aca3a..7c7f66e8 100644\n--- a/testing/test_interpreter.py\n+++ b/testing/test_interpreter.py\n@@ -36,8 +36,7 @@ class BaseTestInterpreter(object):\n     def warnings(self, expected_warnings=None):\n         return self.engine.warnings(expected_warnings)\n \n-    def setup_method(self, method):\n-        self.env_copy = os.environ.copy()\n+    def init_space(self):\n         self.space = ObjSpace()\n         if option.runappdirect:\n             self.engine = self.DirectRunner(self.space)\n@@ -45,7 +44,12 @@ class BaseTestInterpreter(object):\n             self.engine = self.Engine(self.space)\n             self.engine.Interpreter = self.interpreter\n \n-    def teardown_method(self, method):\n+\n+    @py.test.yield_fixture(autouse=True)\n+    def setup_interp(self):\n+        self.env_copy = os.environ.copy()\n+        self.init_space()\n+        yield\n         os.environ = self.env_copy\n         self.engine = None\n         self.space = None\ndiff --git a/testing/test_lexer.py b/testing/test_lexer.py\nindex 54759e67..75542a9e 100644\n--- a/testing/test_lexer.py\n+++ b/testing/test_lexer.py\n@@ -181,6 +181,14 @@ class TestLexer(object):\n             (\'T_END_HEREDOC\', \'X\', 3),\n             (\';\', \';\', 3)]\n \n+    def test_heredoc_with_quoted_dollar(self):\n+        r = self.lex_full("<<<X\\n\\"$\\"\\nX;\\n")\n+        assert r == [\n+            (\'T_START_HEREDOC\', \'<<<X\\n\', 0),\n+            (\'T_ENCAPSED_AND_WHITESPACE\', \'"$"\', 1),\n+            (\'T_END_HEREDOC\', \'X\', 2),\n+            (\';\', \';\', 2)]\n+\n     def test_heredoc_error(self):\n         with pytest.raises(LexerError) as excinfo:\n             self.lex("<<< HERE\\n sadsadasdas\\n")\ndiff --git a/testing/test_locale.py b/testing/test_locale.py\nindex 45ecd063..f5a91acf 100644\n--- a/testing/test_locale.py\n+++ b/testing/test_locale.py\n@@ -26,7 +26,7 @@ def requires_locales(*locales):\n         reason="This test requires locales: %s" % locale_string)\n \n interp = BaseTestInterpreter()\n-interp.setup_method(None)\n+interp.init_space()\n space = interp.space\n \n @requires_locales("fr_FR.ISO8859-1")\ndiff --git a/testing/test_main.py b/testing/test_main.py\nindex 07548696..6675c806 100644\n--- a/testing/test_main.py\n+++ b/testing/test_main.py\n@@ -133,13 +133,13 @@ Stack trace:\n         output = self.run(\'\'\'<?\n         header("xyz")\n         ?>\'\'\', capfd, cgi=True)\n-        assert output == "\\r\\nContent-Type: text/html\\r\\nxyz\\r\\n\\r\\n"\n+        assert output == "Content-Type: text/html\\r\\nxyz\\r\\n\\r\\n"\n \n     def test_headers_replace(self, capfd):\n         output = self.run(\'\'\'<?\n         header("Content-Type: text/css", true);\n         ?>\'\'\', capfd, cgi=True)\n-        assert output == "\\r\\nContent-Type: text/css\\r\\n\\r\\n"\n+        assert output == "Content-Type: text/css\\r\\n\\r\\n"\n \n     def test_hippy_ini_read(self, capfd):\n         tmpdir = tempfile.mkdtemp()\ndiff --git a/testing/test_parse.py b/testing/test_parse.py\nindex e7fcb1ca..555aafd4 100644\n--- a/testing/test_parse.py\n+++ b/testing/test_parse.py\n@@ -1461,6 +1461,14 @@ ENDOFHEREDOC;\n         assert r == Block([Stmt(Print(\n             ConstantStr("This is a heredoc test.", 1)))])\n \n+    def test_heredoc_with_dollar(self):\n+        r = parse("""print <<<ENDOFHEREDOC\n+This is a heredoc with quoted dollar "$".\n+ENDOFHEREDOC;\n+""")\n+        assert r == Block([Stmt(Print(\n+            ConstantStr("This is a heredoc with quoted dollar \\"$\\".", 1)))])\n+\n     def test_index_function_result(self):\n         r = parse(\'f()[0][1];\')\n         assert r == Block([Stmt(GetItem(GetItem(\n@@ -1566,3 +1574,13 @@ ENDOFHEREDOC;\n \n         r = parse_doublequoted("xyz ${a} asd$")\n         assert r == DoubleQuotedStr([ConstantStr("xyz "), NamedVariable("a"), ConstantStr(" asd$")])\n+\n+    def test_parse_error_no_token_name(self):\n+        with raises(ParseError) as excinfo:\n+            parse(\'$foo=;\')\n+        assert excinfo.value.message == "syntax error, unexpected \';\' in <input>"\n+\n+    def test_parse_error_with_token_name(self):\n+        with raises(ParseError) as excinfo:\n+            parse(\'1->2;\')\n+        assert excinfo.value.message == "syntax error, unexpected \'->\' (T_OBJECT_OPERATOR) in <input>"\ndiff --git a/testing/test_refcount.py b/testing/test_refcount.py\nindex cafa9856..cd76bfc1 100644\n--- a/testing/test_refcount.py\n+++ b/testing/test_refcount.py\n@@ -5,15 +5,14 @@ from testing.test_interpreter import BaseTestInterpreter\n \n class TestRefCount(BaseTestInterpreter):\n \n-    def setup_method(self, meth):\n-        super(TestRefCount, self).setup_method(self)\n+    @py.test.yield_fixture(autouse=True)\n+    def note_copies(self):\n         def note_making_a_copy(array):\n             self.space.ec.interpreter.writestr(array.var_dump(self.space, indent=\'\', recursion={}))\n-        self._old_func = W_Root.__dict__[\'_note_making_a_copy\']\n+        old_func = W_Root.__dict__[\'_note_making_a_copy\']\n         W_Root._note_making_a_copy = note_making_a_copy\n-\n-    def teardown_method(self, meth):\n-        W_Root._note_making_a_copy = self._old_func\n+        yield\n+        W_Root._note_making_a_copy = old_func\n \n     def test_no_copies(self):\n         output = self.run("$a = array(5, 6, 7);")\ndiff --git a/testing/test_signal.py b/testing/test_signal.py\nindex dde5fa24..54983f28 100644\n--- a/testing/test_signal.py\n+++ b/testing/test_signal.py\n@@ -1,8 +1,20 @@\n+import signal\n+import pytest\n \n from testing.test_interpreter import BaseTestInterpreter\n from hippy.error import SignalReceived\n \n+\n class TestSignal(BaseTestInterpreter):\n+    @pytest.yield_fixture(autouse=True)\n+    def handle_signals(self, setup_interp):\n+        handler = signal.getsignal(signal.SIGINT)\n+        assert handler is not None\n+        self.space.ec.init_signals()\n+        yield\n+        self.space.ec.clear_signals()\n+        signal.signal(signal.SIGINT, handler)\n+\n     def test_signal(self):\n         import thread, time, os, signal\n \n@@ -11,13 +23,9 @@ class TestSignal(BaseTestInterpreter):\n             os.kill(os.getpid(), signal.SIGINT)\n \n         thread.start_new_thread(f, ())\n-        \n+\n         code = """\n         while (True) { }\n         """\n-        try:\n+        with pytest.raises(SignalReceived):\n             self.run(code)\n-        except SignalReceived:\n-            pass\n-        else:\n-            raise Exception("did not raise")\ndiff --git a/testing/test_standard.py b/testing/test_standard.py\nindex f84a6add..68283d09 100644\n--- a/testing/test_standard.py\n+++ b/testing/test_standard.py\n@@ -1,4 +1,3 @@\n-\n from testing.test_interpreter import BaseTestInterpreter\n \n class TestStandardModule(BaseTestInterpreter):\n@@ -15,3 +14,36 @@ class TestStandardModule(BaseTestInterpreter):\n         assert self.unwrap(output[2]) == "\'\'\\\\\'\'\'"\n         assert self.unwrap(output[3]) == "\'x\'\\\\\'\'y\\"z\'"\n         assert self.unwrap(output[4]) == "\'\\\\\'"\n+\n+    def test_shell_exec(self):\n+        output = self.run(\'\'\'\n+        echo shell_exec(\'doesnotexist\');\n+        echo shell_exec(\'echo 0\');\n+        \'\'\')\n+        assert output[0] == self.space.w_Null\n+        assert self.space.str_w(output[1]) == "0\\n"\n+\n+    def test_exec(self):\n+        output = self.run(\'\'\'\n+        echo exec(\'doesnotexist\');\n+        echo exec(\'echo a && echo b\');\n+        \'\'\')\n+        assert output[0] == self.space.wrap(\'\')\n+        assert self.space.str_w(output[1]) == "b"\n+\n+    def test_exec_error(self):\n+        with self.warnings([\n+                \'Warning: exec(): Cannot execute a blank command\']):\n+            output = self.run(\'\'\'\n+            echo exec(\'\');\n+            echo exec(123);\n+            \'\'\')\n+        assert output == [self.space.w_False, self.space.wrap(\'\')]\n+\n+    def test_exec_2(self):\n+        output = self.run(\'\'\'\n+        $arr = array(\'foo\');\n+        echo exec(\'echo a && echo b\', $arr);\n+        echo $arr;\n+        \'\'\')\n+        assert map(self.space.str_w, output[1].as_list_w()) == [\'foo\', \'a\', \'b\']\ndiff --git a/testing/test_string_funcs.py b/testing/test_string_funcs.py\nindex 9ae30119..3d990cbe 100644\n--- a/testing/test_string_funcs.py\n+++ b/testing/test_string_funcs.py\n@@ -130,6 +130,14 @@ class TestBuiltin(BaseTestInterpreter):\n         output = self.run("echo bin2hex(\'A b-1\');")\n         assert self.space.str_w(output[0]) == "4120622d31"\n \n+    def test_hex2bin(self):\n+        output = self.run(\'\'\'\n+        echo hex2bin(\'4120622d31\');\n+        echo hex2bin(\'6578616d706c65206865782064617461\');\n+        \'\'\')\n+        assert self.space.str_w(output[0]) == "A b-1"\n+        assert self.space.str_w(output[1]) == "example hex data"\n+\n     def test_chr(self):\n         output = self.run(\'\'\'\n         echo chr(97);\n@@ -489,7 +497,7 @@ class TestBuiltin(BaseTestInterpreter):\n         output = self.run("echo stristr(\'abc\', \'d\');")\n         assert self.space.is_w(output[0], self.space.w_False)\n         output = self.run("echo stristr(\'a\', \'\');", [\n-            "Warning: stristr(): Empty delimiter"])\n+            "Warning: stristr(): Empty needle"])\n         assert self.space.is_w(output[0], self.space.w_False)\n \n     def test_strlen(self):\n@@ -572,7 +580,7 @@ class TestBuiltin(BaseTestInterpreter):\n         assert self.space.is_w(output[0], self.space.w_False)\n \n         output = self.run("echo strpos(\'a\', \'\');", [\n-            "Warning: strpos(): Empty delimiter"])\n+            "Warning: strpos(): Empty needle"])\n         assert self.space.is_w(output[0], self.space.w_False)\n \n         output = self.run("echo strpos(\'a\', \'\', 1, 2);", [\n@@ -711,7 +719,7 @@ class TestBuiltin(BaseTestInterpreter):\n         assert all([self.space.is_w(out, self.space.w_False) for out in output])\n \n         output = self.run(\'\'\'echo strstr(\'abc\', \'\');\'\'\', [\n-            "Warning: strstr(): Empty delimiter"])\n+            "Warning: strstr(): Empty needle"])\n         assert self.space.is_w(output[0], self.space.w_False)\n \n     def test_strtr(self):\n@@ -1333,3 +1341,200 @@ ooooord.\'\'\']\n             \'\', \'rrr\'\n \n         ]\n+\n+    def test_quoted_printable_decode(self):\n+        output = self.run(r\'\'\'\n+        echo quoted_printable_decode("=   \\r\\na");\n+        echo quoted_printable_decode("=   \\na");\n+        echo quoted_printable_decode("=   xa");\n+        echo quoted_printable_decode("=f foo");\n+        echo quoted_printable_decode("=f");\n+\n+        \'\'\')\n+        assert [self.space.str_w(w_v) for w_v in output] == [\n+            \'a\', \'a\', \'=   xa\', \'=f foo\', \'=f\'\n+        ]\n+\n+    def test_crc32_basic(self):\n+        output = self.run(\'\'\'\n+        $a = crc32(\'string_val1234\');\n+        echo is_int($a);\n+        echo $a;\n+\n+        \'\'\')\n+        assert [output[0].boolval, self.space.int_w(output[1])] == [\n+            True, 256895812\n+        ]\n+\n+    def test_crc32_variation1(self):\n+        output = self.run(\'\'\'\n+        // declaring class\n+        class sample  {\n+          public function __toString() {\n+            return "object";\n+          }\n+        }\n+\n+        //array of values to iterate over\n+        $values = array(\n+\n+              // int data\n+              0,\n+              1,\n+              12345,\n+              -2345,\n+\n+              // float data\n+              10.5,\n+              -10.5,\n+              10.1234567e10,\n+              10.7654321E-10,\n+              .5,\n+\n+              // null data\n+              NULL,\n+              null,\n+\n+              // boolean data\n+              true,\n+              false,\n+              TRUE,\n+              FALSE,\n+\n+              // empty data\n+              "",\n+              \'\',\n+\n+              // object data\n+              new sample(),\n+        );\n+        foreach($values as $value) {\n+            echo (crc32($value));\n+        };\n+\n+        \'\'\')\n+        expected = [-186917087, -2082672713, -873121252, 1860518047,\n+                    269248583, -834950157, -965354630, 1376932222,\n+                    -2036403827, 0, 0, -2082672713, 0, -2082672713, 0, 0, 0,\n+                    -1465013268]\n+        if sys.maxint >= 2**31:\n+            expected = [e & 0xFFFFFFFF for e in expected]\n+\n+        assert [self.space.int_w(w_v) for w_v in output] == expected\n+\n+        output = self.run(\'\'\'\n+        $unset_var = 10;\n+        unset ($unset_var);\n+        echo crc32($undefined_var);\n+        echo crc32($unset_var);\n+        \'\'\',\n+        [\n+            \'Notice: Undefined variable: undefined_var\',\n+            \'Notice: Undefined variable: unset_var\'\n+        ])\n+        assert [self.space.int_w(w_v) for w_v in output] == [0, 0]\n+\n+        output = self.run(\'\'\'\n+        // declaring class\n+        class sample  {\n+          public function __toString() {\n+            return "object";\n+          }\n+        }\n+\n+        //array of values to iterate over\n+        $values = array(\n+\n+              // array data\n+              array(),\n+              array(0),\n+              array(1),\n+              array(1, 2),\n+              array(\'color\' => \'red\', \'item\' => \'pen\'),\n+        );\n+        foreach($values as $value) {\n+            echo (crc32($value));\n+        };\n+\n+        \'\'\',\n+        [\'Warning: crc32() expects parameter 1 to be string, array given\'] * 5)\n+        assert [self.space.is_w(o, self.space.w_Null) for o in output] == [True] * 5\n+\n+    def test_crc32_variation2(self):\n+        output = self.run(\'\'\'\n+        $string_array = array(\n+          \'\',\n+          \' \',\n+          \'hello world\',\n+          \'HELLO WORLD\',\n+          \' helloworld \',\n+\n+          \'(hello world)\',\n+          \'hello(world)\',\n+          \'helloworld()\',\n+          \'hello()(world\',\n+\n+          \'"hello" world\',\n+          \'hello "world"\',\n+          \'hello""world\',\n+\n+          \'hello\\\\tworld\',\n+          \'hellowor\\\\\\\\tld\',\n+          \'\\\\thello world\\\\t\',\n+          \'hello\\\\nworld\',\n+          \'hellowor\\\\\\\\nld\',\n+          \'\\\\nhello world\\\\n\',\n+          \'\\\\n\\\\thelloworld\',\n+          \'hel\\\\tlo\\\\n world\',\n+\n+          \'!@#$%&\',\n+          \'#hello@world.com\',\n+          \'$hello$world\',\n+        );\n+\n+        // looping to check the behaviour of the function for each string in the array\n+\n+        foreach($string_array as $str) {\n+          echo crc32($str);\n+        }\n+\n+        \'\'\')\n+\n+        # Note: some of the values are different to what is expected in\n+        # test_phpt/ext/standard/strings/crc32_variation2.phpt. However, that\n+        # test seems to be wrong as PHP in Appengine report the values below.\n+        expected = [0, -378745019, 222957957, -2015000997, 1234261835,\n+                    -1867296214, 1048577080, 2129739710, -1633247628, 135755572,\n+                    27384015, -497244052, -2065897232, 243585859, -856440615,\n+                    647088397, 523630053, -2062229676, 1169918910, -618551732,\n+                    -1828940657, -1654468652, -1648442217]\n+        if sys.maxint >= 2**31:\n+            expected = [e & 0xFFFFFFFF for e in expected]\n+\n+        assert [self.space.int_w(w_v) for w_v in output] == expected\n+\n+    def test_crc32_error(self):\n+        output = self.run(\'\'\'\n+        echo crc32();\n+\n+        //Test crc32 with one more than the expected number of arguments\n+        $str = \'string_val\';\n+        $extra_arg = 10;\n+        echo crc32($str, $extra_arg);\n+\n+        \'\'\',\n+        [\n+            \'Warning: crc32() expects exactly 1 parameter, 0 given\',\n+            \'Warning: crc32() expects exactly 1 parameter, 2 given\'\n+        ])\n+\n+        assert [self.space.is_w(o, self.space.w_Null) for o in output] == [True] * 2\n+\n+    def test_hex2bin_invalid_data(self):\n+        output = self.run(\'\'\'\n+        echo hex2bin(\'xx\');\n+        echo hex2bin(\'0123456789abcdefxx\');\n+\n+        \'\'\')\n+\n+        assert [output[0].boolval, output[1].boolval] == [False] * 2\ndiff --git a/travis.sh b/travis.sh\nindex ba02595d..561060a3 100755\n--- a/travis.sh\n+++ b/travis.sh\n@@ -2,14 +2,8 @@\n \n export PYTHONPATH=$PYTHONPATH:pypy\n \n-\n-declare -a STEPS=(\n-    \'py.test testing/ -v\'\n-    \'python pypy/rpython/bin/rpython targethippy.py\'\n-);\n-\n if [[ "$TRANSLATE" == "true" ]]; then\n-    python pypy/rpython/bin/rpython targethippy.py\n+    python pypy/rpython/bin/rpython --batch targethippy.py\n else\n-    py.test "$TESTDIR" -v\n+    eval "py.test $TESTDIR -v"\n fi\n', 'commit_subject': "Merge branch 'master' of github.com:hippyvm/hippyvm", 'repo_name': 'hippyvm/hippyvm', 'committer': {'name': 'Armin Rigo', 'email': 'f77d928ec8cb42235f554d42080cbda291375f27@tunes.org', 'time_sec': '1409475751', 'tz_offset': '120', 'date': {'seconds': '1409475751'}}, 'commit_tree': '03ec2c76516868e782f91c0b4c5c66c2c6cd1380', 'commit_message': "Merge branch 'master' of github.com:hippyvm/hippyvm\n\nConflicts:\n\thippy/bytecode_cache.py\n", 'language_name': 'C', 'license': 'mit', 'hunks': '@@ -2,14 +2,8 @@\n \n export PYTHONPATH=$PYTHONPATH:pypy\n \n-\n-declare -a STEPS=(\n-    \'py.test testing/ -v\'\n-    \'python pypy/rpython/bin/rpython targethippy.py\'\n-);\n-\n if [[ "$TRANSLATE" == "true" ]]; then\n-    python pypy/rpython/bin/rpython targethippy.py\n+    python pypy/rpython/bin/rpython --batch targethippy.py\n else\n-    py.test "$TESTDIR" -v\n+    eval "py.test $TESTDIR -v"\n fi\n', 'addition_count': 2, 'deletion_count': 8, 'src_file': 'a/travis.sh', 'tgt_file': 'b/travis.sh', 'file_extension': '.sh', 'before_file': '#!/bin/bash\n\nexport PYTHONPATH=$PYTHONPATH:pypy\n\n\ndeclare -a STEPS=(\n    \'py.test testing/ -v\'\n    \'python pypy/rpython/bin/rpython targethippy.py\'\n);\n\nif [[ "$TRANSLATE" == "true" ]]; then\n    python pypy/rpython/bin/rpython targethippy.py\nelse\n    py.test "$TESTDIR" -v\nfi\n', 'message': "Merge branch 'master' of github.com:hippyvm/hippyvm\n\nConflicts:\n\thippy/bytecode_cache.py\n", 'author_name': 'Armin Rigo', 'lang': 'sh'}