CVE-2014-125107 (HTML, published 2023-12-19T03:15Z)
Description: value: A vulnerability was found in Corveda PHPSandbox 1.3.4 and classified as critical. Affected by this issue is some unknown functionality of the component String Handler. The manipulation leads to protection mechanism failure. The attack may be launched remotely. Upgrading to version 1.3.5 is able to address this issue. The patch is identified as 48fde5ffa4d76014bad260a3cbab7ada3744a4cc. It is recommended to upgrade the affected component. VDB-248270 is the identifier assigned to this vulnerability.
Severity: nan (CVSS v3 base score: 5.3)
Weakness: CWE-693 \u2014 Protection Mechanism Failure
The product does not use or incorrectly uses a protection mechanism that provides sufficient defense against directed attacks against the product.
Repository: https://github.com/Corveda/PHPSandbox
Files changed:
CHANGELOG.md
LICENSE
MANUAL.html
README.md
docs/classes/PHPSandbox.Error.html
docs/classes/PHPSandbox.PHPSandbox.html
docs/classes/PHPSandbox.SandboxWhitelistVisitor.html
docs/classes/PHPSandbox.SandboxedString.html
docs/classes/PHPSandbox.ValidatorVisitor.html
docs/classes/PHPSandbox.WhitelistVisitor.html
docs/files/Error.php.html
docs/files/Error.php.txt
docs/files/PHPSandbox.php.html
docs/files/PHPSandbox.php.txt
docs/files/SandboxWhitelistVisitor.php.html
docs/files/SandboxWhitelistVisitor.php.txt
docs/files/SandboxedString.php.html
docs/files/SandboxedString.php.txt
docs/files/ValidatorVisitor.php.html
docs/files/ValidatorVisitor.php.txt
docs/files/WhitelistVisitor.php.html
docs/files/WhitelistVisitor.php.txt
docs/graphs/class.html
docs/index.html
docs/namespaces/PHPSandbox.html
docs/namespaces/default.html
docs/reports/deprecated.html
docs/reports/errors.html
docs/reports/markers.html
src/PHPSandbox/Error.php
src/PHPSandbox/PHPSandbox.php
src/PHPSandbox/SandboxWhitelistVisitor.php
src/PHPSandbox/SandboxedString.php
src/PHPSandbox/ValidatorVisitor.php
src/PHPSandbox/WhitelistVisitor.php
tests/PHPSandbox/Tests/Config/DefaultConfigTest.php
toolkit/index.php
toolkit/templates/002 - Evil Function.json	
Commit message: - Addressed potential vulnerabilities related to SandboxedStrings where sandboxed code could manipulate the strings in a way that could defeat their protection
- Solved errors from casting sandboxed strings to int
- Overwrote some internal PHP functions to further mask SandboxedStrings from the sandboxed code and prevent type-checking errors
- Added more tests related to SandboxedStrings
- Made some minor tweaks to PHPSandbox Toolkit


Vulnerable code:
Copyright (c) 2013 by Elijah Horton (fieryprophet [at] yahoo.com)
                    PHPSandbox Toolkit 1.3.1
[![Build Status](https://travis-ci.org/fieryprophet/php-sandbox.png?branch=master)](https://travis-ci.org/fieryprophet/php-sandbox)

[![Scrutinizer Quality Score](https://scrutinizer-ci.com/g/fieryprophet/php-sandbox/badges/quality-score.png?s=4f2d82525b9e2c6bae18e26cf643ca3fd09333fc)](https://scrutinizer-ci.com/g/fieryprophet/php-sandbox/)

[![Code Coverage](https://scrutinizer-ci.com/g/fieryprophet/php-sandbox/badges/coverage.png?s=d6cef7d18a66d2ac39b76410b76c89fa15d84b8c)](https://scrutinizer-ci.com/g/fieryprophet/php-sandbox/)
                                    <a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-553992218"></a>
            <div id="namespace-553992218" class="accordion-body collapse in">
                                    <a class="accordion-toggle collapsed" data-toggle="collapse" data-target="#namespace-2135081389"></a>
            <div id="namespace-2135081389" class="accordion-body collapse ">
                    on March 5th, 2014 at 04:43.
                                    <a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-148348232"></a>
            <div id="namespace-148348232" class="accordion-body collapse in">
                                    <a class="accordion-toggle collapsed" data-toggle="collapse" data-target="#namespace-1647787725"></a>
            <div id="namespace-1647787725" class="accordion-body collapse ">
                                                                    <a href="../classes/PHPSandbox.PHPSandbox.html#method__var_dump" class="">_var_dump()</a><br />
                                                                    <a href="../classes/PHPSandbox.PHPSandbox.html#method__print_r" class="">_print_r()</a><br />
                                                                    <a href="../classes/PHPSandbox.PHPSandbox.html#method__var_export" class="">_var_export()</a><br />
                                                                    <a href="../classes/PHPSandbox.PHPSandbox.html#property_var_funcs" class="">$var_funcs</a><br />
                                                                    <a href="../classes/PHPSandbox.PHPSandbox.html#property_overwrite_var_funcs" class="">$overwrite_var_funcs</a><br />
            <a id="property_var_funcs" name="property_var_funcs" class="anchor"></a>
                <h3 class="public ">$var_funcs</h3>
                <pre class="signature">$var_funcs : array</pre>
                &mdash; A static array of var_dump, print_r and var_export for redefining those functions                            </article>
            <a id="property_arg_funcs" name="property_arg_funcs" class="anchor"></a>
                <h3 class="public ">$arg_funcs</h3>
                <pre class="signature">$arg_funcs : array</pre>
                &mdash; A static array of func_get_args, func_get_arg, and func_num_args used for redefining those functions                            </article>
            <a id="property_overwrite_var_funcs" name="property_overwrite_var_funcs" class="anchor"></a>
                <h3 class="public ">$overwrite_var_funcs</h3>
                <pre class="signature">$overwrite_var_funcs : bool</pre>
                &mdash; Should PHPSandbox overwrite var_dump, print_r, and var_export?                            </article>
            <a id="property_overwrite_func_get_args" name="property_overwrite_func_get_args" class="anchor"></a>
                <h3 class="public ">$overwrite_func_get_args</h3>
                <pre class="signature">$overwrite_func_get_args : bool</pre>
                &mdash; Should PHPSandbox overwrite func_get_args, func_get_arg and func_num_args?                            </article>
                &mdash; Should PHPSandbox overwrite $_GET, $_POST, $_COOKIE, $_FILES, $_ENV, $_REQUEST, $_SERVER, $_SESSION and $GLOBALS superglobals? If so, unless alternate superglobal values have been defined they will return as empty arrays.                            </article>
            <a id="method__func_get_args" name="method__func_get_args" class="anchor"></a>
                <h3 class="public ">_func_get_args()</h3>
                <pre class="signature" style="margin-right: 54px;">_func_get_args(array <span class="argument">$arguments</span>) : array</pre>
                <p><em>Get PHPSandbox redefined function arguments array</em></p>
                                <td>array</td>
                                <td>$arguments</td>
                                <td><p>Array result from func_get_args() is passed here</p>
                    array
                                            &mdash; <p>Returns the redefined arguments array</p>
            <a id="method__func_get_arg" name="method__func_get_arg" class="anchor"></a>
                <h3 class="public ">_func_get_arg()</h3>
                <pre class="signature" style="margin-right: 54px;">_func_get_arg(array <span class="argument">$arguments</span>, int <span class="argument">$index</span>) : array</pre>
                <p><em>Get PHPSandbox redefined function argument</em></p>
                                <td>array</td>
                                <td>$arguments</td>
                                <td><p>Array result from func_get_args() is passed here</p>
                                <td>int</td>
                                <td>$index</td>
                                <td><p>Requested func_get_arg index is passed here</p>
                                            &mdash; <p>Returns the redefined argument</p>
            <a id="method__func_num_args" name="method__func_num_args" class="anchor"></a>
                <h3 class="public ">_func_num_args()</h3>
                <pre class="signature" style="margin-right: 54px;">_func_num_args(array <span class="argument">$arguments</span>) : int</pre>
                <p><em>Get PHPSandbox redefined number of function arguments</em></p>
                                <td>array</td>
                                <td>$arguments</td>
                                <td><p>Array result from func_get_args() is passed here</p>
                    int
                                            &mdash; <p>Returns the redefined number of function arguments</p>
                    on March 5th, 2014 at 04:43.
                                    <a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-174531007"></a>
            <div id="namespace-174531007" class="accordion-body collapse in">
                                    <a class="accordion-toggle collapsed" data-toggle="collapse" data-target="#namespace-1263837536"></a>
            <div id="namespace-1263837536" class="accordion-body collapse ">
                    on March 5th, 2014 at 04:43.
                                    <a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-298168079"></a>
            <div id="namespace-298168079" class="accordion-body collapse in">
                                    <a class="accordion-toggle collapsed" data-toggle="collapse" data-target="#namespace-171292534"></a>
            <div id="namespace-171292534" class="accordion-body collapse ">
                    on March 5th, 2014 at 04:43.
                                    <a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-190716146"></a>
            <div id="namespace-190716146" class="accordion-body collapse in">
                                    <a class="accordion-toggle collapsed" data-toggle="collapse" data-target="#namespace-1067596443"></a>
            <div id="namespace-1067596443" class="accordion-body collapse ">
                                    <h4>Throws</h4>
                    <dl>
                                                    <dt>\PHPSandbox\Error</dt>
                            <dd><p>Throws exception if $node attempts to cast when $allow_casting is false in the PHPSandbox configuration</p>
</dd>
                                                                    </dl>
                    on March 5th, 2014 at 04:43.
                                    <a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-1971830681"></a>
            <div id="namespace-1971830681" class="accordion-body collapse in">
                                    <a class="accordion-toggle collapsed" data-toggle="collapse" data-target="#namespace-868130616"></a>
            <div id="namespace-868130616" class="accordion-body collapse ">
                    on March 5th, 2014 at 04:43.
                                    <a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-1697921261"></a>
            <div id="namespace-1697921261" class="accordion-body collapse in">
                                    <a class="accordion-toggle collapsed" data-toggle="collapse" data-target="#namespace-130381843"></a>
            <div id="namespace-130381843" class="accordion-body collapse ">
                    on March 5th, 2014 at 04:43.
     * @version 1.3.2
                                    <a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-555703967"></a>
            <div id="namespace-555703967" class="accordion-body collapse in">
                                    <a class="accordion-toggle collapsed" data-toggle="collapse" data-target="#namespace-2138167363"></a>
            <div id="namespace-2138167363" class="accordion-body collapse ">
                    on March 5th, 2014 at 04:43.
     * @version 1.3.2
        /**
         * @var    array          A static array of var_dump, print_r and var_export for redefining those functions
         */
        public static $var_funcs = array(
            'var_dump',
            'print_r',
            'var_export'
        );
        /**
         * @var    bool       Should PHPSandbox overwrite var_dump, print_r, and var_export?
         * @default true
         */
        public $overwrite_var_funcs         = true;
        /** Get PHPSandbox redefined function arguments array
         * @param   array           $arguments      Array result from func_get_args() is passed here
         * @return  array           Returns the redefined arguments array
        public function _func_get_args(array $arguments = array()){
            foreach($arguments as $index => $value){
                if($value instanceof self){
                    unset($arguments[$index]); //hide PHPSandbox variable
                }
            }
            return $arguments;
        /** Get PHPSandbox redefined function argument
         * @param   array           $arguments      Array result from func_get_args() is passed here
         * @param   int             $index          Requested func_get_arg index is passed here
         * @return  array           Returns the redefined argument
        public function _func_get_arg(array $arguments = array(), $index = 0){
            if($arguments[$index] instanceof self){
                $index++;   //get next argument instead
            return isset($arguments[$index]) && !($arguments[$index] instanceof self) ? $arguments[$index] : null;
        /** Get PHPSandbox redefined number of function arguments
         * @param   array           $arguments      Array result from func_get_args() is passed here
         * @return  int             Returns the redefined number of function arguments
        public function _func_num_args(array $arguments = array()){
            $count = count($arguments);
            foreach($arguments as $argument){
                if($argument instanceof self){
                    $count--;
                }
            return $count > 0 ? $count : 0;
                "\r\n" . 'if( PHP_MAJOR_VERSION >= 5 && PHP_MINOR_VERSION > 3){ $closure = $closure->bindTo(null); }' .
                                    <a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-891059786"></a>
            <div id="namespace-891059786" class="accordion-body collapse in">
                                    <a class="accordion-toggle collapsed" data-toggle="collapse" data-target="#namespace-337296115"></a>
            <div id="namespace-337296115" class="accordion-body collapse ">
                    on March 5th, 2014 at 04:43.
     * @version 1.3.2
                                    <a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-1040308460"></a>
            <div id="namespace-1040308460" class="accordion-body collapse in">
                                    <a class="accordion-toggle collapsed" data-toggle="collapse" data-target="#namespace-418048951"></a>
            <div id="namespace-418048951" class="accordion-body collapse ">
                    on March 5th, 2014 at 04:43.
     * @version 1.3.2
    class SandboxedString {
         * @param   string      $value      Original string value
         * @param   PHPSandbox  $sandbox    The current sandbox instance to test against
                    || (in_array($name, PHPSandbox::$var_funcs) && $this->sandbox->overwrite_var_funcs)
            return null;
                                    <a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-907988671"></a>
            <div id="namespace-907988671" class="accordion-body collapse in">
                                    <a class="accordion-toggle collapsed" data-toggle="collapse" data-target="#namespace-194642397"></a>
            <div id="namespace-194642397" class="accordion-body collapse ">
                    on March 5th, 2014 at 04:43.
     * @version 1.3.2
                    if($this->sandbox->overwrite_var_funcs && in_array($name, PHPSandbox::$var_funcs)){
         * @throws  Error             Throws exception if $node attempts to cast when $allow_casting is false in the PHPSandbox configuration
         *
            switch($node->getType()){
                case 'Expr_Cast_Array':
                case 'Expr_Cast_Bool':
                case 'Expr_Cast_Double':
                case 'Expr_Cast_Int':
                case 'Expr_Cast_String':
                case 'Expr_Cast_Object':
                case 'Expr_Cast_Unset':
                    if(!$this->sandbox->allow_casting){
                        $this->sandbox->error("Sandboxed code attempted to cast!", Error::CAST_ERROR, $node);
                    }
                    break;
            }
                                    <a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-854772276"></a>
            <div id="namespace-854772276" class="accordion-body collapse in">
                                    <a class="accordion-toggle collapsed" data-toggle="collapse" data-target="#namespace-1662890078"></a>
            <div id="namespace-1662890078" class="accordion-body collapse ">
                    on March 5th, 2014 at 04:43.
     * @version 1.3.2
                    on March 5th, 2014 at 04:43.
                                    <a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-1624839564"></a>
            <div id="namespace-1624839564" class="accordion-body collapse in">
                                    <a class="accordion-toggle collapsed" data-toggle="collapse" data-target="#namespace-1810365709"></a>
            <div id="namespace-1810365709" class="accordion-body collapse ">
                    on March 5th, 2014 at 04:43.
                                    <a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-25397207"></a>
            <div id="namespace-25397207" class="accordion-body collapse in">
                                    <a class="accordion-toggle collapsed" data-toggle="collapse" data-target="#namespace-134930522"></a>
            <div id="namespace-134930522" class="accordion-body collapse ">
                    on March 5th, 2014 at 04:43.
                                    <a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-170220695"></a>
            <div id="namespace-170220695" class="accordion-body collapse in">
                                    <a class="accordion-toggle collapsed" data-toggle="collapse" data-target="#namespace-1814876905"></a>
            <div id="namespace-1814876905" class="accordion-body collapse ">
                    on March 5th, 2014 at 04:43.
                    on March 5th, 2014 at 04:43.
                            <small style="float: right;padding-right: 10px;">1</small>
                                        <td>6607</td>
                    on March 5th, 2014 at 04:43.
                    on March 5th, 2014 at 04:43.
     * @version 1.3.2
     * @version 1.3.2
        /**
         * @var    array          A static array of var_dump, print_r and var_export for redefining those functions
         */
        public static $var_funcs = array(
            'var_dump',
            'print_r',
            'var_export'
        );
        /**
         * @var    bool       Should PHPSandbox overwrite var_dump, print_r, and var_export?
         * @default true
         */
        public $overwrite_var_funcs         = true;
        /** Get PHPSandbox redefined function arguments array
         * @param   array           $arguments      Array result from func_get_args() is passed here
         * @return  array           Returns the redefined arguments array
        public function _func_get_args(array $arguments = array()){
            foreach($arguments as $index => $value){
                if($value instanceof self){
                    unset($arguments[$index]); //hide PHPSandbox variable
                }
            }
            return $arguments;
        /** Get PHPSandbox redefined function argument
         * @param   array           $arguments      Array result from func_get_args() is passed here
         * @param   int             $index          Requested func_get_arg index is passed here
         * @return  array           Returns the redefined argument
        public function _func_get_arg(array $arguments = array(), $index = 0){
            if($arguments[$index] instanceof self){
                $index++;   //get next argument instead
            return isset($arguments[$index]) && !($arguments[$index] instanceof self) ? $arguments[$index] : null;
        /** Get PHPSandbox redefined number of function arguments
         * @param   array           $arguments      Array result from func_get_args() is passed here
         * @return  int             Returns the redefined number of function arguments
        public function _func_num_args(array $arguments = array()){
            $count = count($arguments);
            foreach($arguments as $argument){
                if($argument instanceof self){
                    $count--;
                }
            return $count > 0 ? $count : 0;
                "\r\n" . 'if( PHP_MAJOR_VERSION >= 5 && PHP_MINOR_VERSION > 3){ $closure = $closure->bindTo(null); }' .
     * @version 1.3.2
     * @version 1.3.2
    class SandboxedString {
         * @param   string      $value      Original string value
         * @param   PHPSandbox  $sandbox    The current sandbox instance to test against
                    || (in_array($name, PHPSandbox::$var_funcs) && $this->sandbox->overwrite_var_funcs)
            return null;
     * @version 1.3.2
                    if($this->sandbox->overwrite_var_funcs && in_array($name, PHPSandbox::$var_funcs)){
         * @throws  Error             Throws exception if $node attempts to cast when $allow_casting is false in the PHPSandbox configuration
         *
            switch($node->getType()){
                case 'Expr_Cast_Array':
                case 'Expr_Cast_Bool':
                case 'Expr_Cast_Double':
                case 'Expr_Cast_Int':
                case 'Expr_Cast_String':
                case 'Expr_Cast_Object':
                case 'Expr_Cast_Unset':
                    if(!$this->sandbox->allow_casting){
                        $this->sandbox->error("Sandboxed code attempted to cast!", Error::CAST_ERROR, $node);
                    }
                    break;
            }
     * @version 1.3.2
        $sandbox->set_error_handler(function(\PHPSandbox\Error $e){ echo '<h2 style="color: red;">' . $e->getMessage() . '</h2>'; });
            echo '<h2 style="color: red;">' . $e->getMessage() . '</h2>';
{"code":"\/*\n    This template demonstrates how an eval is blocked\n    if the eval function is not allowed\n*\/\n\neval('echo \"This should not work if eval is disallowed.\"');","options":{"allow_variables":"0"},"blacklist":null,"whitelist":null}

Fixed code:
##03/10/2014
- Addressed potential vulnerabilities related to SandboxedStrings where sandboxed code could manipulate the strings in a way that could defeat their protection
- Solved errors from casting sandboxed strings to int
- Overwrote some internal PHP functions to further mask SandboxedStrings from the sandboxed code and prevent type-checking errors
- Added more tests related to SandboxedStrings
- Made some minor tweaks to PHPSandbox Toolkit

Copyright (c) 2013-2014 by Elijah Horton (fieryprophet [at] yahoo.com)
                    PHPSandbox Toolkit 1.3.3
[![Build Status](https://travis-ci.org/fieryprophet/php-sandbox.png?branch=master)](https://travis-ci.org/fieryprophet/php-sandbox) [![Scrutinizer Quality Score](https://scrutinizer-ci.com/g/fieryprophet/php-sandbox/badges/quality-score.png?s=4f2d82525b9e2c6bae18e26cf643ca3fd09333fc)](https://scrutinizer-ci.com/g/fieryprophet/php-sandbox/) [![Code Coverage](https://scrutinizer-ci.com/g/fieryprophet/php-sandbox/badges/coverage.png?s=d6cef7d18a66d2ac39b76410b76c89fa15d84b8c)](https://scrutinizer-ci.com/g/fieryprophet/php-sandbox/) [![Latest Stable Version](https://poser.pugx.org/fieryprophet/php-sandbox/v/stable.png)](https://packagist.org/packages/fieryprophet/php-sandbox) [![Total Downloads](https://poser.pugx.org/fieryprophet/php-sandbox/downloads.png)](https://packagist.org/packages/fieryprophet/php-sandbox) [![Latest Unstable Version](https://poser.pugx.org/fieryprophet/php-sandbox/v/unstable.png)](https://packagist.org/packages/fieryprophet/php-sandbox) [![License](https://poser.pugx.org/fieryprophet/php-sandbox/license.png)](https://packagist.org/packages/fieryprophet/php-sandbox)
                                    <a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-2138946611"></a>
            <div id="namespace-2138946611" class="accordion-body collapse in">
                                    <a class="accordion-toggle collapsed" data-toggle="collapse" data-target="#namespace-288135741"></a>
            <div id="namespace-288135741" class="accordion-body collapse ">
                    on March 10th, 2014 at 20:56.
                                    <a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-1578178908"></a>
            <div id="namespace-1578178908" class="accordion-body collapse in">
                                    <a class="accordion-toggle collapsed" data-toggle="collapse" data-target="#namespace-736098440"></a>
            <div id="namespace-736098440" class="accordion-body collapse ">
                                                                    <a href="../classes/PHPSandbox.PHPSandbox.html#method__wrap" class="">_wrap()</a><br />
                                                                    <a href="../classes/PHPSandbox.PHPSandbox.html#method__var_dump" class="">_var_dump()</a><br />
                                                                    <a href="../classes/PHPSandbox.PHPSandbox.html#method__print_r" class="">_print_r()</a><br />
                                                                    <a href="../classes/PHPSandbox.PHPSandbox.html#method__var_export" class="">_var_export()</a><br />
                                                                    <a href="../classes/PHPSandbox.PHPSandbox.html#method__intval" class="">_intval()</a><br />
                                                                    <a href="../classes/PHPSandbox.PHPSandbox.html#method__floatval" class="">_floatval()</a><br />
                                                                    <a href="../classes/PHPSandbox.PHPSandbox.html#method__arrayval" class="">_arrayval()</a><br />
                                                                    <a href="../classes/PHPSandbox.PHPSandbox.html#method__objectval" class="">_objectval()</a><br />
                                                                    <a href="../classes/PHPSandbox.PHPSandbox.html#method__is_string" class="">_is_string()</a><br />
                                                                    <a href="../classes/PHPSandbox.PHPSandbox.html#method__is_object" class="">_is_object()</a><br />
                                                                    <a href="../classes/PHPSandbox.PHPSandbox.html#method__is_scalar" class="">_is_scalar()</a><br />
                                                                    <a href="../classes/PHPSandbox.PHPSandbox.html#method__is_callable" class="">_is_callable()</a><br />
                                                                    <a href="../classes/PHPSandbox.PHPSandbox.html#property_sandboxed_string_funcs" class="">$sandboxed_string_funcs</a><br />
                                                                    <a href="../classes/PHPSandbox.PHPSandbox.html#property_overwrite_sandboxed_string_funcs" class="">$overwrite_sandboxed_string_funcs</a><br />
            <a id="property_arg_funcs" name="property_arg_funcs" class="anchor"></a>
                <h3 class="public ">$arg_funcs</h3>
                <pre class="signature">$arg_funcs : array</pre>
                &mdash; A static array of func_get_args, func_get_arg, and func_num_args used for redefining those functions                            </article>
            <a id="property_sandboxed_string_funcs" name="property_sandboxed_string_funcs" class="anchor"></a>
                <h3 class="public ">$sandboxed_string_funcs</h3>
                <pre class="signature">$sandboxed_string_funcs : array</pre>
                &mdash; A static array of var_dump, print_r and var_export, intval, floatval, is_string, is_object,
                         is_scalar and is_callable for redefining those functions                            </article>
            <a id="property_overwrite_func_get_args" name="property_overwrite_func_get_args" class="anchor"></a>
                <h3 class="public ">$overwrite_func_get_args</h3>
                <pre class="signature">$overwrite_func_get_args : bool</pre>
                &mdash; Should PHPSandbox overwrite func_get_args, func_get_arg and func_num_args?                            </article>
            <a id="property_overwrite_sandboxed_string_funcs" name="property_overwrite_sandboxed_string_funcs" class="anchor"></a>
                <h3 class="public ">$overwrite_sandboxed_string_funcs</h3>
                <pre class="signature">$overwrite_sandboxed_string_funcs : bool</pre>
                &mdash; Should PHPSandbox overwrite $_GET, $_POST, $_COOKIE, $_FILES, $_ENV, $_REQUEST, $_SERVER, $_SESSION and $GLOBALS superglobals? If so, unless alternate superglobal values have been defined they will return as empty arrays.                            </article>
                &mdash; Should PHPSandbox overwrite functions to help hide SandboxedStrings?                            </article>
            <a id="method__func_get_args" name="method__func_get_args" class="anchor"></a>
            <article class="method">
                <h3 class="public ">_func_get_args()</h3>
                <a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
                <pre class="signature" style="margin-right: 54px;">_func_get_args(array <span class="argument">$arguments</span>) : array</pre>
                <p><em>Get PHPSandbox redefined function arguments array</em></p>
                


                                    <h4>Parameters</h4>
                    <table class="table table-condensed table-hover">
                                                    <tr>
                                <td>array</td>
                                <td>$arguments</td>
                                <td><p>Array result from func_get_args() is passed here</p>
</td>
                            </tr>
                                            </table>
                
                
                                    <h4>Returns</h4>
                    array
                                            &mdash; <p>Returns the redefined arguments array</p>

                                                </article>
        </div>
        <aside class="span4 detailsbar">
            <h1><i class="icon-arrow-down"></i></h1>
                                                            <dl>
                                                                            </dl>
            <h2>Tags</h2>
            <table class="table table-condensed">
                                    <tr><td colspan="2"><em>None found</em></td></tr>
                            </table>
        </aside>
    </div>

                                    <div class="row-fluid">
        <div class="span8 content class">
            <a id="method__func_get_arg" name="method__func_get_arg" class="anchor"></a>
            <article class="method">
                <h3 class="public ">_func_get_arg()</h3>
                <a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
                <pre class="signature" style="margin-right: 54px;">_func_get_arg(array <span class="argument">$arguments</span>, int <span class="argument">$index</span>) : array</pre>
                <p><em>Get PHPSandbox redefined function argument</em></p>
                


                                    <h4>Parameters</h4>
                    <table class="table table-condensed table-hover">
                                                    <tr>
                                <td>array</td>
                                <td>$arguments</td>
                                <td><p>Array result from func_get_args() is passed here</p>
</td>
                            </tr>
                                                    <tr>
                                <td>int</td>
                                <td>$index</td>
                                <td><p>Requested func_get_arg index is passed here</p>
</td>
                            </tr>
                                            </table>
                
                
                                    <h4>Returns</h4>
                    array
                                            &mdash; <p>Returns the redefined argument</p>

                                                </article>
        </div>
        <aside class="span4 detailsbar">
            <h1><i class="icon-arrow-down"></i></h1>
                                                            <dl>
                                                                            </dl>
            <h2>Tags</h2>
            <table class="table table-condensed">
                                    <tr><td colspan="2"><em>None found</em></td></tr>
                            </table>
        </aside>
    </div>

                                    <div class="row-fluid">
        <div class="span8 content class">
            <a id="method__func_num_args" name="method__func_num_args" class="anchor"></a>
            <article class="method">
                <h3 class="public ">_func_num_args()</h3>
                <a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
                <pre class="signature" style="margin-right: 54px;">_func_num_args(array <span class="argument">$arguments</span>) : int</pre>
                <p><em>Get PHPSandbox redefined number of function arguments</em></p>
                


                                    <h4>Parameters</h4>
                    <table class="table table-condensed table-hover">
                                                    <tr>
                                <td>array</td>
                                <td>$arguments</td>
                                <td><p>Array result from func_get_args() is passed here</p>
</td>
                            </tr>
                                            </table>
                
                
                                    <h4>Returns</h4>
                    int
                                            &mdash; <p>Returns the redefined number of function arguments</p>

                                                </article>
        </div>
        <aside class="span4 detailsbar">
            <h1><i class="icon-arrow-down"></i></h1>
                                                            <dl>
                                                                            </dl>
            <h2>Tags</h2>
            <table class="table table-condensed">
                                    <tr><td colspan="2"><em>None found</em></td></tr>
                            </table>
        </aside>
    </div>

                                    <div class="row-fluid">
        <div class="span8 content class">
            <a id="method__wrap" name="method__wrap" class="anchor"></a>
            <article class="method">
                <h3 class="public ">_wrap()</h3>
                <a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
                <pre class="signature" style="margin-right: 54px;">_wrap(mixed <span class="argument">$value</span>) : mixed|\PHPSandbox\SandboxedString</pre>
                <p><em>Wrap output value in SandboxString</em></p>
                


                                    <h4>Parameters</h4>
                    <table class="table table-condensed table-hover">
                                                    <tr>
                                <td>mixed</td>
                                <td>$value</td>
                                <td><p>Value to wrap</p>
</td>
                            </tr>
                                            </table>
                
                
                                    <h4>Returns</h4>
                    mixed|<a href="../classes/PHPSandbox.SandboxedString.html">\PHPSandbox\SandboxedString</a>
                                            &mdash; <p>Returns the wrapped value</p>

                                                </article>
        </div>
        <aside class="span4 detailsbar">
            <h1><i class="icon-arrow-down"></i></h1>
                                                            <dl>
                                                                            </dl>
            <h2>Tags</h2>
            <table class="table table-condensed">
                                    <tr><td colspan="2"><em>None found</em></td></tr>
                            </table>
        </aside>
    </div>

                                    <div class="row-fluid">
        <div class="span8 content class">
            <a id="method__intval" name="method__intval" class="anchor"></a>
                <h3 class="public ">_intval()</h3>
                <pre class="signature" style="margin-right: 54px;">_intval(mixed <span class="argument">$value</span>) : int</pre>
                <p><em>Return integer value of SandboxedString or mixed value</em></p>
                                <td>mixed</td>
                                <td>$value</td>
                                <td><p>Value to return as integer</p>
                    int
                                            &mdash; <p>Returns the integer value</p>
            <a id="method__floatval" name="method__floatval" class="anchor"></a>
                <h3 class="public ">_floatval()</h3>
                <pre class="signature" style="margin-right: 54px;">_floatval(mixed <span class="argument">$value</span>) : float</pre>
                <p><em>Return float value of SandboxedString or mixed value</em></p>
                                <td>mixed</td>
                                <td>$value</td>
                                <td><p>Value to return as float</p>
                                            </table>
                
                
                                    <h4>Returns</h4>
                    float
                                            &mdash; <p>Returns the float value</p>

                                                </article>
        </div>
        <aside class="span4 detailsbar">
            <h1><i class="icon-arrow-down"></i></h1>
                                                            <dl>
                                                                            </dl>
            <h2>Tags</h2>
            <table class="table table-condensed">
                                    <tr><td colspan="2"><em>None found</em></td></tr>
                            </table>
        </aside>
    </div>

                                    <div class="row-fluid">
        <div class="span8 content class">
            <a id="method__arrayval" name="method__arrayval" class="anchor"></a>
            <article class="method">
                <h3 class="public ">_arrayval()</h3>
                <a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
                <pre class="signature" style="margin-right: 54px;">_arrayval(mixed <span class="argument">$value</span>) : array</pre>
                <p><em>Return array value of SandboxedString or mixed value</em></p>
                


                                    <h4>Parameters</h4>
                    <table class="table table-condensed table-hover">
                                <td>mixed</td>
                                <td>$value</td>
                                <td><p>Value to return as array</p>
                                            &mdash; <p>Returns the array value</p>
            <a id="method__objectval" name="method__objectval" class="anchor"></a>
                <h3 class="public ">_objectval()</h3>
                <pre class="signature" style="margin-right: 54px;">_objectval(mixed <span class="argument">$value</span>) : object</pre>
                <p><em>Return object value of SandboxedString or mixed value</em></p>
                                <td>mixed</td>
                                <td>$value</td>
                                <td><p>Value to return as object</p>
                    object
                                            &mdash; <p>Returns the object value</p>

                                                </article>
        </div>
        <aside class="span4 detailsbar">
            <h1><i class="icon-arrow-down"></i></h1>
                                                            <dl>
                                                                            </dl>
            <h2>Tags</h2>
            <table class="table table-condensed">
                                    <tr><td colspan="2"><em>None found</em></td></tr>
                            </table>
        </aside>
    </div>

                                    <div class="row-fluid">
        <div class="span8 content class">
            <a id="method__is_string" name="method__is_string" class="anchor"></a>
            <article class="method">
                <h3 class="public ">_is_string()</h3>
                <a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
                <pre class="signature" style="margin-right: 54px;">_is_string(mixed <span class="argument">$value</span>) : bool</pre>
                <p><em>Return is_string value of SandboxedString or mixed value</em></p>
                


                                    <h4>Parameters</h4>
                    <table class="table table-condensed table-hover">
                                                    <tr>
                                <td>mixed</td>
                                <td>$value</td>
                                <td><p>Value to check if is_string</p>
</td>
                            </tr>
                                            </table>
                
                
                                    <h4>Returns</h4>
                    bool
                                            &mdash; <p>Returns the is_string value</p>

                                                </article>
        </div>
        <aside class="span4 detailsbar">
            <h1><i class="icon-arrow-down"></i></h1>
                                                            <dl>
                                                                            </dl>
            <h2>Tags</h2>
            <table class="table table-condensed">
                                    <tr><td colspan="2"><em>None found</em></td></tr>
                            </table>
        </aside>
    </div>

                                    <div class="row-fluid">
        <div class="span8 content class">
            <a id="method__is_object" name="method__is_object" class="anchor"></a>
            <article class="method">
                <h3 class="public ">_is_object()</h3>
                <a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
                <pre class="signature" style="margin-right: 54px;">_is_object(mixed <span class="argument">$value</span>) : bool</pre>
                <p><em>Return is_object value of SandboxedString or mixed value</em></p>
                


                                    <h4>Parameters</h4>
                    <table class="table table-condensed table-hover">
                                                    <tr>
                                <td>mixed</td>
                                <td>$value</td>
                                <td><p>Value to check if is_object</p>
</td>
                            </tr>
                                            </table>
                
                
                                    <h4>Returns</h4>
                    bool
                                            &mdash; <p>Returns the is_object value</p>

                                                </article>
        </div>
        <aside class="span4 detailsbar">
            <h1><i class="icon-arrow-down"></i></h1>
                                                            <dl>
                                                                            </dl>
            <h2>Tags</h2>
            <table class="table table-condensed">
                                    <tr><td colspan="2"><em>None found</em></td></tr>
                            </table>
        </aside>
    </div>

                                    <div class="row-fluid">
        <div class="span8 content class">
            <a id="method__is_scalar" name="method__is_scalar" class="anchor"></a>
            <article class="method">
                <h3 class="public ">_is_scalar()</h3>
                <a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
                <pre class="signature" style="margin-right: 54px;">_is_scalar(mixed <span class="argument">$value</span>) : bool</pre>
                <p><em>Return is_scalar value of SandboxedString or mixed value</em></p>
                


                                    <h4>Parameters</h4>
                    <table class="table table-condensed table-hover">
                                                    <tr>
                                <td>mixed</td>
                                <td>$value</td>
                                <td><p>Value to check if is_scalar</p>
</td>
                            </tr>
                                            </table>
                
                
                                    <h4>Returns</h4>
                    bool
                                            &mdash; <p>Returns the is_scalar value</p>

                                                </article>
        </div>
        <aside class="span4 detailsbar">
            <h1><i class="icon-arrow-down"></i></h1>
                                                            <dl>
                                                                            </dl>
            <h2>Tags</h2>
            <table class="table table-condensed">
                                    <tr><td colspan="2"><em>None found</em></td></tr>
                            </table>
        </aside>
    </div>

                                    <div class="row-fluid">
        <div class="span8 content class">
            <a id="method__is_callable" name="method__is_callable" class="anchor"></a>
            <article class="method">
                <h3 class="public ">_is_callable()</h3>
                <a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
                <pre class="signature" style="margin-right: 54px;">_is_callable(mixed <span class="argument">$value</span>) : bool</pre>
                <p><em>Return is_callable value of SandboxedString or mixed value</em></p>
                


                                    <h4>Parameters</h4>
                    <table class="table table-condensed table-hover">
                                                    <tr>
                                <td>mixed</td>
                                <td>$value</td>
                                <td><p>Value to check if is_callable</p>
</td>
                            </tr>
                                            </table>
                
                
                                    <h4>Returns</h4>
                    bool
                                            &mdash; <p>Returns the is_callable value</p>
                    on March 10th, 2014 at 20:56.
                                    <a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-872821338"></a>
            <div id="namespace-872821338" class="accordion-body collapse in">
                                    <a class="accordion-toggle collapsed" data-toggle="collapse" data-target="#namespace-2118974906"></a>
            <div id="namespace-2118974906" class="accordion-body collapse ">
                    on March 10th, 2014 at 20:56.
                                    <a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-2041490650"></a>
            <div id="namespace-2041490650" class="accordion-body collapse in">
                                    <a class="accordion-toggle collapsed" data-toggle="collapse" data-target="#namespace-2075822163"></a>
            <div id="namespace-2075822163" class="accordion-body collapse ">
                                                                    <a href="../classes/PHPSandbox.SandboxedString.html#method_offsetSet" class="">offsetSet()</a><br />
                                                                    <a href="../classes/PHPSandbox.SandboxedString.html#method_offsetGet" class="">offsetGet()</a><br />
                                                                    <a href="../classes/PHPSandbox.SandboxedString.html#method_offsetExists" class="">offsetExists()</a><br />
                                                                    <a href="../classes/PHPSandbox.SandboxedString.html#method_offsetUnset" class="">offsetUnset()</a><br />
                                                                    <a href="../classes/PHPSandbox.SandboxedString.html#method_getIterator" class="">getIterator()</a><br />
                                    <div class="row-fluid">
        <div class="span8 content class">
            <a id="method_offsetSet" name="method_offsetSet" class="anchor"></a>
            <article class="method">
                <h3 class="public ">offsetSet()</h3>
                <a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
                <pre class="signature" style="margin-right: 54px;">offsetSet(mixed <span class="argument">$offset</span>, mixed <span class="argument">$value</span>)</pre>
                <p><em>Set string value at specified offset</em></p>
                


                                    <h4>Parameters</h4>
                    <table class="table table-condensed table-hover">
                                                    <tr>
                                <td>mixed</td>
                                <td>$offset</td>
                                <td><p>Offset to set value</p>
</td>
                            </tr>
                                                    <tr>
                                <td>mixed</td>
                                <td>$value</td>
                                <td><p>Value to set</p>
</td>
                            </tr>
                                            </table>
                
                
                            </article>
        </div>
        <aside class="span4 detailsbar">
            <h1><i class="icon-arrow-down"></i></h1>
                                                            <dl>
                                                                            </dl>
            <h2>Tags</h2>
            <table class="table table-condensed">
                                    <tr><td colspan="2"><em>None found</em></td></tr>
                            </table>
        </aside>
    </div>

                                    <div class="row-fluid">
        <div class="span8 content class">
            <a id="method_offsetGet" name="method_offsetGet" class="anchor"></a>
            <article class="method">
                <h3 class="public ">offsetGet()</h3>
                <a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
                <pre class="signature" style="margin-right: 54px;">offsetGet(mixed <span class="argument">$offset</span>) : string</pre>
                <p><em>Get string value at specified offset</em></p>
                


                                    <h4>Parameters</h4>
                    <table class="table table-condensed table-hover">
                                                    <tr>
                                <td>mixed</td>
                                <td>$offset</td>
                                <td><p>Offset to get value</p>
</td>
                            </tr>
                                            </table>
                
                
                                    <h4>Returns</h4>
                    string
                                            &mdash; <p>Value to return</p>

                                                </article>
        </div>
        <aside class="span4 detailsbar">
            <h1><i class="icon-arrow-down"></i></h1>
                                                            <dl>
                                                                            </dl>
            <h2>Tags</h2>
            <table class="table table-condensed">
                                    <tr><td colspan="2"><em>None found</em></td></tr>
                            </table>
        </aside>
    </div>

                                    <div class="row-fluid">
        <div class="span8 content class">
            <a id="method_offsetExists" name="method_offsetExists" class="anchor"></a>
            <article class="method">
                <h3 class="public ">offsetExists()</h3>
                <a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
                <pre class="signature" style="margin-right: 54px;">offsetExists(mixed <span class="argument">$offset</span>) : bool</pre>
                <p><em>Check if specified offset exists in string value</em></p>
                


                                    <h4>Parameters</h4>
                    <table class="table table-condensed table-hover">
                                                    <tr>
                                <td>mixed</td>
                                <td>$offset</td>
                                <td><p>Offset to check</p>
</td>
                            </tr>
                                            </table>
                
                
                                    <h4>Returns</h4>
                    bool
                                            &mdash; <p>Return true if offset exists, false otherwise</p>

                                                </article>
        </div>
        <aside class="span4 detailsbar">
            <h1><i class="icon-arrow-down"></i></h1>
                                                            <dl>
                                                                            </dl>
            <h2>Tags</h2>
            <table class="table table-condensed">
                                    <tr><td colspan="2"><em>None found</em></td></tr>
                            </table>
        </aside>
    </div>

                                    <div class="row-fluid">
        <div class="span8 content class">
            <a id="method_offsetUnset" name="method_offsetUnset" class="anchor"></a>
            <article class="method">
                <h3 class="public ">offsetUnset()</h3>
                <a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
                <pre class="signature" style="margin-right: 54px;">offsetUnset(mixed <span class="argument">$offset</span>)</pre>
                <p><em>Unset string value at specified offset</em></p>
                


                                    <h4>Parameters</h4>
                    <table class="table table-condensed table-hover">
                                                    <tr>
                                <td>mixed</td>
                                <td>$offset</td>
                                <td><p>Offset to unset</p>
</td>
                            </tr>
                                            </table>
                
                
                            </article>
        </div>
        <aside class="span4 detailsbar">
            <h1><i class="icon-arrow-down"></i></h1>
                                                            <dl>
                                                                            </dl>
            <h2>Tags</h2>
            <table class="table table-condensed">
                                    <tr><td colspan="2"><em>None found</em></td></tr>
                            </table>
        </aside>
    </div>

                                    <div class="row-fluid">
        <div class="span8 content class">
            <a id="method_getIterator" name="method_getIterator" class="anchor"></a>
            <article class="method">
                <h3 class="public ">getIterator()</h3>
                <a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
                <pre class="signature" style="margin-right: 54px;">getIterator() : \ArrayIterator</pre>
                <p><em>Return iterator for string value</em></p>
                


                
                
                                    <h4>Returns</h4>
                    \ArrayIterator
                                            &mdash; <p>Array iterator to return</p>

                                                </article>
        </div>
        <aside class="span4 detailsbar">
            <h1><i class="icon-arrow-down"></i></h1>
                                                            <dl>
                                                                            </dl>
            <h2>Tags</h2>
            <table class="table table-condensed">
                                    <tr><td colspan="2"><em>None found</em></td></tr>
                            </table>
        </aside>
    </div>

                    on March 10th, 2014 at 20:56.
                                    <a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-761076047"></a>
            <div id="namespace-761076047" class="accordion-body collapse in">
                                    <a class="accordion-toggle collapsed" data-toggle="collapse" data-target="#namespace-1291512294"></a>
            <div id="namespace-1291512294" class="accordion-body collapse ">
                    on March 10th, 2014 at 20:56.
                                    <a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-2090806726"></a>
            <div id="namespace-2090806726" class="accordion-body collapse in">
                                    <a class="accordion-toggle collapsed" data-toggle="collapse" data-target="#namespace-185668004"></a>
            <div id="namespace-185668004" class="accordion-body collapse ">
                    on March 10th, 2014 at 20:56.
                                    <a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-174432776"></a>
            <div id="namespace-174432776" class="accordion-body collapse in">
                                    <a class="accordion-toggle collapsed" data-toggle="collapse" data-target="#namespace-7998099"></a>
            <div id="namespace-7998099" class="accordion-body collapse ">
                    on March 10th, 2014 at 20:56.
     * @version 1.3.3
                                    <a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-101492745"></a>
            <div id="namespace-101492745" class="accordion-body collapse in">
                                    <a class="accordion-toggle collapsed" data-toggle="collapse" data-target="#namespace-288228325"></a>
            <div id="namespace-288228325" class="accordion-body collapse ">
                    on March 10th, 2014 at 20:56.
     * @version 1.3.3
        /**
         * @var    array          A static array of var_dump, print_r and var_export, intval, floatval, is_string, is_object,
         *                          is_scalar and is_callable for redefining those functions
         */
        public static $sandboxed_string_funcs = array(
            'var_dump',
            'print_r',
            'var_export',
            'intval',
            'floatval',
            'is_string',
            'is_object',
            'is_scalar',
            'is_callable'
        );
        public $overwrite_sandboxed_string_funcs         = true;
        /**
         * @var    bool       Should PHPSandbox overwrite functions to help hide SandboxedStrings?
         * @default true
         */
        /** Get PHPSandbox redefined function arguments array
         *
         * @param   array           $arguments      Array result from func_get_args() is passed here
         *
         * @return  array           Returns the redefined arguments array
         */
        public function _func_get_args(array $arguments = array()){
            foreach($arguments as $index => $value){
                if($value instanceof self){
                    unset($arguments[$index]); //hide PHPSandbox variable
                }
            }
            return $arguments;
        }
        /** Get PHPSandbox redefined function argument
         *
         * @param   array           $arguments      Array result from func_get_args() is passed here
         *
         * @param   int             $index          Requested func_get_arg index is passed here
         *
         * @return  array           Returns the redefined argument
         */
        public function _func_get_arg(array $arguments = array(), $index = 0){
            if($arguments[$index] instanceof self){
                $index++;   //get next argument instead
            }
            return isset($arguments[$index]) && !($arguments[$index] instanceof self) ? $arguments[$index] : null;
        }
        /** Get PHPSandbox redefined number of function arguments
         *
         * @param   array           $arguments      Array result from func_get_args() is passed here
         *
         * @return  int             Returns the redefined number of function arguments
         */
        public function _func_num_args(array $arguments = array()){
            $count = count($arguments);
            foreach($arguments as $argument){
                if($argument instanceof self){
                    $count--;
                }
            }
            return $count > 0 ? $count : 0;
        }
        /** Wrap output value in SandboxString
         *
         * @param   mixed                   $value      Value to wrap
         *
         * @return  mixed|SandboxedString   Returns the wrapped value
         */
        public function _wrap($value){
            return is_string($value) ? new SandboxedString($value, $this) : $value;
        }
        /** Return integer value of SandboxedString or mixed value
         * @param   mixed           $value      Value to return as integer
         * @return  int             Returns the integer value
        public function _intval($value){
            return intval($value instanceof SandboxedString ? strval($value): $value);
        /** Return float value of SandboxedString or mixed value
         * @param   mixed           $value      Value to return as float
         * @return  float           Returns the float value
         */
        public function _floatval($value){
            return floatval($value instanceof SandboxedString ? strval($value): $value);
        }
        /** Return array value of SandboxedString or mixed value
         * @param   mixed           $value      Value to return as array
         *
         * @return  array           Returns the array value
        public function _arrayval($value){
            if($value instanceof SandboxedString){
                return (array)strval($value);
            return is_array($value) ? $value : (array)$value;
        /** Return object value of SandboxedString or mixed value
         * @param   mixed           $value      Value to return as object
         * @return  object          Returns the object value
        public function _objectval($value){
            if($value instanceof SandboxedString){
                return (object)strval($value);
            return is_object($value) ? $value : (object)$value;
        }
        /** Return is_string value of SandboxedString or mixed value
         *
         * @param   mixed           $value      Value to check if is_string
         *
         * @return  bool            Returns the is_string value
         */
        public function _is_string($value){
            return ($value instanceof SandboxedString) ? true : is_string($value);
        }
        /** Return is_object value of SandboxedString or mixed value
         *
         * @param   mixed           $value      Value to check if is_object
         *
         * @return  bool            Returns the is_object value
         */
        public function _is_object($value){
            return ($value instanceof SandboxedString) ? false : is_object($value);
        }
        /** Return is_scalar value of SandboxedString or mixed value
         *
         * @param   mixed           $value      Value to check if is_scalar
         *
         * @return  bool            Returns the is_scalar value
         */
        public function _is_scalar($value){
            return ($value instanceof SandboxedString) ? true : is_scalar($value);
        }
        /** Return is_callable value of SandboxedString or mixed value
         *
         * @param   mixed           $value      Value to check if is_callable
         *
         * @return  bool            Returns the is_callable value
         */
        public function _is_callable($value){
            if($value instanceof SandboxedString){
                $value = strval($value);
            }
            return is_callable($value);
            } else if($name instanceof SandboxedString){
                $name = strval($name);
            if($name instanceof SandboxedString){
                $name = strval($name);
            }
            if($name instanceof SandboxedString){
                $name = strval($name);
            }
            if($name instanceof SandboxedString){
                $name = strval($name);
            }
            if($name instanceof SandboxedString){
                $name = strval($name);
            }
            if($name instanceof SandboxedString){
                $name = strval($name);
            }
            if($name instanceof SandboxedString){
                $name = strval($name);
            }
            if($name instanceof SandboxedString){
                $name = strval($name);
            }
            if($name instanceof SandboxedString){
                $name = strval($name);
            }
            if($name instanceof SandboxedString){
                $name = strval($name);
            }
            if($name instanceof SandboxedString){
                $name = strval($name);
            }
            if($name instanceof SandboxedString){
                $name = strval($name);
            }
            if($name instanceof SandboxedString){
                $name = strval($name);
            }
            if($name instanceof SandboxedString){
                $name = strval($name);
            }
            if($name instanceof SandboxedString){
                $name = strval($name);
            }
                "\r\n" . 'if(method_exists($closure, "bindTo")){ $closure = $closure->bindTo(null); }' .
                                    <a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-2011979904"></a>
            <div id="namespace-2011979904" class="accordion-body collapse in">
                                    <a class="accordion-toggle collapsed" data-toggle="collapse" data-target="#namespace-1143894290"></a>
            <div id="namespace-1143894290" class="accordion-body collapse ">
                    on March 10th, 2014 at 20:56.
     * @version 1.3.3
                                    <a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-1701606012"></a>
            <div id="namespace-1701606012" class="accordion-body collapse in">
                                    <a class="accordion-toggle collapsed" data-toggle="collapse" data-target="#namespace-1646168305"></a>
            <div id="namespace-1646168305" class="accordion-body collapse ">
                    on March 10th, 2014 at 20:56.
     * @version 1.3.3
    class SandboxedString implements \ArrayAccess, \IteratorAggregate {
         * @param   string      $value          Original string value
         * @param   PHPSandbox  $sandbox        The current sandbox instance to test against
                    || (in_array($name, PHPSandbox::$sandboxed_string_funcs) && $this->sandbox->overwrite_sandboxed_string_funcs)
            return '';
        }
        /** Set string value at specified offset
         * @param   mixed       $offset            Offset to set value
         * @param   mixed       $value             Value to set
         */
        public function offsetSet($offset, $value){
            if($offset === null){
                $this->value .= $value;
            } else {
                $this->value[$offset] = $value;
            }
        }
        /** Get string value at specified offset
         * @param   mixed       $offset            Offset to get value
         *
         * @return  string      Value to return
         */
        public function offsetGet($offset){
            return $this->value[$offset];
        }
        /** Check if specified offset exists in string value
         * @param   mixed       $offset            Offset to check
         *
         * @return  bool        Return true if offset exists, false otherwise
         */
        public function offsetExists($offset){
            return isset($this->value[$offset]);
        }
        /** Unset string value at specified offset
         * @param   mixed       $offset            Offset to unset
         */
        public function offsetUnset($offset){
            unset($this->value[$offset]);
        }
        /** Return iterator for string value
         * @return  \ArrayIterator      Array iterator to return
         */
        public function getIterator(){
            return new \ArrayIterator(str_split(strval($this->value)));
                                    <a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-999918227"></a>
            <div id="namespace-999918227" class="accordion-body collapse in">
                                    <a class="accordion-toggle collapsed" data-toggle="collapse" data-target="#namespace-226640883"></a>
            <div id="namespace-226640883" class="accordion-body collapse ">
                    on March 10th, 2014 at 20:56.
     * @version 1.3.3
            } else if($node instanceof \PHPParser_Node_Expr_Cast_String){
                return new \PHPParser_Node_Expr_New(new \PHPParser_Node_Name_FullyQualified(array('PHPSandbox\\SandboxedString')), array(new \PHPParser_Node_Arg($node->expr), new \PHPParser_Node_Arg(new \PHPParser_Node_Expr_StaticCall(new \PHPParser_Node_Name_FullyQualified("PHPSandbox\\PHPSandbox"), 'getSandbox', array(new \PHPParser_Node_Scalar_String($this->sandbox->name))))));
                if($node instanceof \PHPParser_Node_Expr_Cast_Int){
                    return new \PHPParser_Node_Expr_MethodCall(new \PHPParser_Node_Expr_StaticCall(new \PHPParser_Node_Name_FullyQualified("PHPSandbox\\PHPSandbox"), 'getSandbox', array(new \PHPParser_Node_Scalar_String($this->sandbox->name))), '_intval', array(new \PHPParser_Node_Arg($node->expr)), $node->getAttributes());
                } else if($node instanceof \PHPParser_Node_Expr_Cast_Double){
                    return new \PHPParser_Node_Expr_MethodCall(new \PHPParser_Node_Expr_StaticCall(new \PHPParser_Node_Name_FullyQualified("PHPSandbox\\PHPSandbox"), 'getSandbox', array(new \PHPParser_Node_Scalar_String($this->sandbox->name))), '_floatval', array(new \PHPParser_Node_Arg($node->expr)), $node->getAttributes());
                } else if($node instanceof \PHPParser_Node_Expr_Cast_Array){
                    return new \PHPParser_Node_Expr_MethodCall(new \PHPParser_Node_Expr_StaticCall(new \PHPParser_Node_Name_FullyQualified("PHPSandbox\\PHPSandbox"), 'getSandbox', array(new \PHPParser_Node_Scalar_String($this->sandbox->name))), '_arrayval', array(new \PHPParser_Node_Arg($node->expr)), $node->getAttributes());
                } else if($node instanceof \PHPParser_Node_Expr_Cast_Object){
                    return new \PHPParser_Node_Expr_MethodCall(new \PHPParser_Node_Expr_StaticCall(new \PHPParser_Node_Name_FullyQualified("PHPSandbox\\PHPSandbox"), 'getSandbox', array(new \PHPParser_Node_Scalar_String($this->sandbox->name))), '_objectval', array(new \PHPParser_Node_Arg($node->expr)), $node->getAttributes());
                }
                    if($this->sandbox->overwrite_sandboxed_string_funcs && in_array($name, PHPSandbox::$sandboxed_string_funcs)){
                    return new \PHPParser_Node_Expr_MethodCall(new \PHPParser_Node_Expr_StaticCall(new \PHPParser_Node_Name_FullyQualified("PHPSandbox\\PHPSandbox"), 'getSandbox', array(new \PHPParser_Node_Scalar_String($this->sandbox->name))), '_wrap', array(new \PHPParser_Node_Arg($node)), $node->getAttributes());
                if($node instanceof \PHPParser_Node_Expr_Concat){
                    return new \PHPParser_Node_Expr_New(new \PHPParser_Node_Name_FullyQualified(array('PHPSandbox\\SandboxedString')), array(new \PHPParser_Node_Arg($node), new \PHPParser_Node_Arg(new \PHPParser_Node_Expr_StaticCall(new \PHPParser_Node_Name_FullyQualified("PHPSandbox\\PHPSandbox"), 'getSandbox', array(new \PHPParser_Node_Scalar_String($this->sandbox->name))))));
                } else if($node instanceof \PHPParser_Node_Expr_AssignConcat){
                    return new \PHPParser_Node_Expr_Assign($node->var, new \PHPParser_Node_Expr_New(new \PHPParser_Node_Name_FullyQualified(array('PHPSandbox\\SandboxedString')), array(new \PHPParser_Node_Arg(new \PHPParser_Node_Expr_Concat($node->var, $node->expr)), new \PHPParser_Node_Arg(new \PHPParser_Node_Expr_StaticCall(new \PHPParser_Node_Name_FullyQualified("PHPSandbox\\PHPSandbox"), 'getSandbox', array(new \PHPParser_Node_Scalar_String($this->sandbox->name)))))));
                }
                                    <a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-1453035608"></a>
            <div id="namespace-1453035608" class="accordion-body collapse in">
                                    <a class="accordion-toggle collapsed" data-toggle="collapse" data-target="#namespace-91137763"></a>
            <div id="namespace-91137763" class="accordion-body collapse ">
                    on March 10th, 2014 at 20:56.
     * @version 1.3.3
                    on March 10th, 2014 at 20:56.
                                    <a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-751769504"></a>
            <div id="namespace-751769504" class="accordion-body collapse in">
                                    <a class="accordion-toggle collapsed" data-toggle="collapse" data-target="#namespace-1827995365"></a>
            <div id="namespace-1827995365" class="accordion-body collapse ">
                    on March 10th, 2014 at 20:56.
                                    <a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-2043401959"></a>
            <div id="namespace-2043401959" class="accordion-body collapse in">
                                    <a class="accordion-toggle collapsed" data-toggle="collapse" data-target="#namespace-158188391"></a>
            <div id="namespace-158188391" class="accordion-body collapse ">
                    on March 10th, 2014 at 20:56.
                                    <a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-2146406286"></a>
            <div id="namespace-2146406286" class="accordion-body collapse in">
                                    <a class="accordion-toggle collapsed" data-toggle="collapse" data-target="#namespace-44708510"></a>
            <div id="namespace-44708510" class="accordion-body collapse ">
                    on March 10th, 2014 at 20:56.
                    on March 10th, 2014 at 20:56.
                            <small style="float: right;padding-right: 10px;">2</small>
                                        <td>6748</td>
                                        <td>Argument $name is missing from the Docblock of getSandbox()</td>
                                    </tr>
                                                                    <tr>
                                        <td>error</td>
                                        <td>6748</td>
                    on March 10th, 2014 at 20:56.
                    on March 10th, 2014 at 20:56.
     * @version 1.3.3
     * @version 1.3.3
        /**
         * @var    array          A static array of var_dump, print_r and var_export, intval, floatval, is_string, is_object,
         *                          is_scalar and is_callable for redefining those functions
         */
        public static $sandboxed_string_funcs = array(
            'var_dump',
            'print_r',
            'var_export',
            'intval',
            'floatval',
            'is_string',
            'is_object',
            'is_scalar',
            'is_callable'
        );
        public $overwrite_sandboxed_string_funcs         = true;
        /**
         * @var    bool       Should PHPSandbox overwrite functions to help hide SandboxedStrings?
         * @default true
         */
        /** Get PHPSandbox redefined function arguments array
         *
         * @param   array           $arguments      Array result from func_get_args() is passed here
         *
         * @return  array           Returns the redefined arguments array
         */
        public function _func_get_args(array $arguments = array()){
            foreach($arguments as $index => $value){
                if($value instanceof self){
                    unset($arguments[$index]); //hide PHPSandbox variable
                }
            }
            return $arguments;
        }
        /** Get PHPSandbox redefined function argument
         *
         * @param   array           $arguments      Array result from func_get_args() is passed here
         *
         * @param   int             $index          Requested func_get_arg index is passed here
         *
         * @return  array           Returns the redefined argument
         */
        public function _func_get_arg(array $arguments = array(), $index = 0){
            if($arguments[$index] instanceof self){
                $index++;   //get next argument instead
            }
            return isset($arguments[$index]) && !($arguments[$index] instanceof self) ? $arguments[$index] : null;
        }
        /** Get PHPSandbox redefined number of function arguments
         *
         * @param   array           $arguments      Array result from func_get_args() is passed here
         *
         * @return  int             Returns the redefined number of function arguments
         */
        public function _func_num_args(array $arguments = array()){
            $count = count($arguments);
            foreach($arguments as $argument){
                if($argument instanceof self){
                    $count--;
                }
            }
            return $count > 0 ? $count : 0;
        }
        /** Wrap output value in SandboxString
         *
         * @param   mixed                   $value      Value to wrap
         *
         * @return  mixed|SandboxedString   Returns the wrapped value
         */
        public function _wrap($value){
            return is_string($value) ? new SandboxedString($value, $this) : $value;
        }
        /** Return integer value of SandboxedString or mixed value
         * @param   mixed           $value      Value to return as integer
         * @return  int             Returns the integer value
        public function _intval($value){
            return intval($value instanceof SandboxedString ? strval($value): $value);
        /** Return float value of SandboxedString or mixed value
         * @param   mixed           $value      Value to return as float
         * @return  float           Returns the float value
         */
        public function _floatval($value){
            return floatval($value instanceof SandboxedString ? strval($value): $value);
        }
        /** Return array value of SandboxedString or mixed value
         * @param   mixed           $value      Value to return as array
         *
         * @return  array           Returns the array value
        public function _arrayval($value){
            if($value instanceof SandboxedString){
                return (array)strval($value);
            return is_array($value) ? $value : (array)$value;
        /** Return object value of SandboxedString or mixed value
         * @param   mixed           $value      Value to return as object
         * @return  object          Returns the object value
        public function _objectval($value){
            if($value instanceof SandboxedString){
                return (object)strval($value);
            return is_object($value) ? $value : (object)$value;
        }
        /** Return is_string value of SandboxedString or mixed value
         *
         * @param   mixed           $value      Value to check if is_string
         *
         * @return  bool            Returns the is_string value
         */
        public function _is_string($value){
            return ($value instanceof SandboxedString) ? true : is_string($value);
        }
        /** Return is_object value of SandboxedString or mixed value
         *
         * @param   mixed           $value      Value to check if is_object
         *
         * @return  bool            Returns the is_object value
         */
        public function _is_object($value){
            return ($value instanceof SandboxedString) ? false : is_object($value);
        }
        /** Return is_scalar value of SandboxedString or mixed value
         *
         * @param   mixed           $value      Value to check if is_scalar
         *
         * @return  bool            Returns the is_scalar value
         */
        public function _is_scalar($value){
            return ($value instanceof SandboxedString) ? true : is_scalar($value);
        }
        /** Return is_callable value of SandboxedString or mixed value
         *
         * @param   mixed           $value      Value to check if is_callable
         *
         * @return  bool            Returns the is_callable value
         */
        public function _is_callable($value){
            if($value instanceof SandboxedString){
                $value = strval($value);
            }
            return is_callable($value);
            } else if($name instanceof SandboxedString){
                $name = strval($name);
            if($name instanceof SandboxedString){
                $name = strval($name);
            }
            if($name instanceof SandboxedString){
                $name = strval($name);
            }
            if($name instanceof SandboxedString){
                $name = strval($name);
            }
            if($name instanceof SandboxedString){
                $name = strval($name);
            }
            if($name instanceof SandboxedString){
                $name = strval($name);
            }
            if($name instanceof SandboxedString){
                $name = strval($name);
            }
            if($name instanceof SandboxedString){
                $name = strval($name);
            }
            if($name instanceof SandboxedString){
                $name = strval($name);
            }
            if($name instanceof SandboxedString){
                $name = strval($name);
            }
            if($name instanceof SandboxedString){
                $name = strval($name);
            }
            if($name instanceof SandboxedString){
                $name = strval($name);
            }
            if($name instanceof SandboxedString){
                $name = strval($name);
            }
            if($name instanceof SandboxedString){
                $name = strval($name);
            }
            if($name instanceof SandboxedString){
                $name = strval($name);
            }
                "\r\n" . 'if(method_exists($closure, "bindTo")){ $closure = $closure->bindTo(null); }' .
     * @version 1.3.3
     * @version 1.3.3
    class SandboxedString implements \ArrayAccess, \IteratorAggregate {
         * @param   string      $value          Original string value
         * @param   PHPSandbox  $sandbox        The current sandbox instance to test against
                    || (in_array($name, PHPSandbox::$sandboxed_string_funcs) && $this->sandbox->overwrite_sandboxed_string_funcs)
            return '';
        }
        /** Set string value at specified offset
         * @param   mixed       $offset            Offset to set value
         * @param   mixed       $value             Value to set
         */
        public function offsetSet($offset, $value){
            if($offset === null){
                $this->value .= $value;
            } else {
                $this->value[$offset] = $value;
            }
        }
        /** Get string value at specified offset
         * @param   mixed       $offset            Offset to get value
         *
         * @return  string      Value to return
         */
        public function offsetGet($offset){
            return $this->value[$offset];
        }
        /** Check if specified offset exists in string value
         * @param   mixed       $offset            Offset to check
         *
         * @return  bool        Return true if offset exists, false otherwise
         */
        public function offsetExists($offset){
            return isset($this->value[$offset]);
        }
        /** Unset string value at specified offset
         * @param   mixed       $offset            Offset to unset
         */
        public function offsetUnset($offset){
            unset($this->value[$offset]);
        }
        /** Return iterator for string value
         * @return  \ArrayIterator      Array iterator to return
         */
        public function getIterator(){
            return new \ArrayIterator(str_split(strval($this->value)));
     * @version 1.3.3
            } else if($node instanceof \PHPParser_Node_Expr_Cast_String){
                return new \PHPParser_Node_Expr_New(new \PHPParser_Node_Name_FullyQualified(array('PHPSandbox\\SandboxedString')), array(new \PHPParser_Node_Arg($node->expr), new \PHPParser_Node_Arg(new \PHPParser_Node_Expr_StaticCall(new \PHPParser_Node_Name_FullyQualified("PHPSandbox\\PHPSandbox"), 'getSandbox', array(new \PHPParser_Node_Scalar_String($this->sandbox->name))))));
                if($node instanceof \PHPParser_Node_Expr_Cast_Int){
                    return new \PHPParser_Node_Expr_MethodCall(new \PHPParser_Node_Expr_StaticCall(new \PHPParser_Node_Name_FullyQualified("PHPSandbox\\PHPSandbox"), 'getSandbox', array(new \PHPParser_Node_Scalar_String($this->sandbox->name))), '_intval', array(new \PHPParser_Node_Arg($node->expr)), $node->getAttributes());
                } else if($node instanceof \PHPParser_Node_Expr_Cast_Double){
                    return new \PHPParser_Node_Expr_MethodCall(new \PHPParser_Node_Expr_StaticCall(new \PHPParser_Node_Name_FullyQualified("PHPSandbox\\PHPSandbox"), 'getSandbox', array(new \PHPParser_Node_Scalar_String($this->sandbox->name))), '_floatval', array(new \PHPParser_Node_Arg($node->expr)), $node->getAttributes());
                } else if($node instanceof \PHPParser_Node_Expr_Cast_Array){
                    return new \PHPParser_Node_Expr_MethodCall(new \PHPParser_Node_Expr_StaticCall(new \PHPParser_Node_Name_FullyQualified("PHPSandbox\\PHPSandbox"), 'getSandbox', array(new \PHPParser_Node_Scalar_String($this->sandbox->name))), '_arrayval', array(new \PHPParser_Node_Arg($node->expr)), $node->getAttributes());
                } else if($node instanceof \PHPParser_Node_Expr_Cast_Object){
                    return new \PHPParser_Node_Expr_MethodCall(new \PHPParser_Node_Expr_StaticCall(new \PHPParser_Node_Name_FullyQualified("PHPSandbox\\PHPSandbox"), 'getSandbox', array(new \PHPParser_Node_Scalar_String($this->sandbox->name))), '_objectval', array(new \PHPParser_Node_Arg($node->expr)), $node->getAttributes());
                }
                    if($this->sandbox->overwrite_sandboxed_string_funcs && in_array($name, PHPSandbox::$sandboxed_string_funcs)){
                    return new \PHPParser_Node_Expr_MethodCall(new \PHPParser_Node_Expr_StaticCall(new \PHPParser_Node_Name_FullyQualified("PHPSandbox\\PHPSandbox"), 'getSandbox', array(new \PHPParser_Node_Scalar_String($this->sandbox->name))), '_wrap', array(new \PHPParser_Node_Arg($node)), $node->getAttributes());
                if($node instanceof \PHPParser_Node_Expr_Concat){
                    return new \PHPParser_Node_Expr_New(new \PHPParser_Node_Name_FullyQualified(array('PHPSandbox\\SandboxedString')), array(new \PHPParser_Node_Arg($node), new \PHPParser_Node_Arg(new \PHPParser_Node_Expr_StaticCall(new \PHPParser_Node_Name_FullyQualified("PHPSandbox\\PHPSandbox"), 'getSandbox', array(new \PHPParser_Node_Scalar_String($this->sandbox->name))))));
                } else if($node instanceof \PHPParser_Node_Expr_AssignConcat){
                    return new \PHPParser_Node_Expr_Assign($node->var, new \PHPParser_Node_Expr_New(new \PHPParser_Node_Name_FullyQualified(array('PHPSandbox\\SandboxedString')), array(new \PHPParser_Node_Arg(new \PHPParser_Node_Expr_Concat($node->var, $node->expr)), new \PHPParser_Node_Arg(new \PHPParser_Node_Expr_StaticCall(new \PHPParser_Node_Name_FullyQualified("PHPSandbox\\PHPSandbox"), 'getSandbox', array(new \PHPParser_Node_Scalar_String($this->sandbox->name)))))));
                }
     * @version 1.3.3

        /**
         * Test whether sandbox disallows violating callbacks even with manipulated sandboxed strings
         */
        public function testCallbackViolationsWithStringManipulation(){
            $this->setExpectedException('PHPSandbox\Error');
            $this->sandbox->execute(function(){ $x = substr("var_dump2", 0, -1); array_filter(array("1"), $x); });
        }

        /**
         * Test whether sandboxed strings do not cause conflicts with intval
         */
        public function testSandboxedStringsSatisfyIntval(){
            $this->sandbox->whitelist_func('intval');
            $this->assertEquals(1, $this->sandbox->execute(function(){ return intval("1"); }));
        }

        /**
         * Test whether sandboxed strings do not cause conflicts with is_string, is_object, or is_scalar
         */
        public function testSandboxedStringsMimicStrings(){
            $this->sandbox->whitelist_func(array(
                'is_string',
                'is_object',
                'is_scalar'
            ));
            $this->assertEquals(true, $this->sandbox->execute(function(){ return is_string("1"); }));
            $this->assertEquals(false, $this->sandbox->execute(function(){ return is_object("1"); }));
            $this->assertEquals(true, $this->sandbox->execute(function(){ return is_scalar("1"); }));
        }
        $sandbox->set_error_handler(function(\PHPSandbox\Error $e){ die('<h2 style="color: red;">' . $e->getMessage() . '</h2>'); });
            die('<h2 style="color: red;">' . $e->getMessage() . '</h2>');
    <div align="center" style="font-size: 8px; font-weight: bold;">&copy; Copyright 2013 - <?php echo date("Y"); ?> Elijah Horton. - Some Rights Reserved.<br/>See <a href="../LICENSE" target="_blank">LICENSE</a> for details.</div>
    <br/>
{"code":"\/*\n    This template demonstrates how an eval is blocked\n    if the eval function is not allowed\n*\/\n\neval('echo \"This should not work if eval is disallowed.\";');","options":{"allow_variables":"0"},"blacklist":null,"whitelist":null}