<?php
namespace KDambekalns\Faker;

/*                                                                        *
 * This script belongs to the Flow package "Faker".                       *
 *                                                                        */

/**
 * Faker class for the Faker package
 *
 * The Faker package is based on http://faker.rubyforge.org/
 */
class Faker
{
    /**
     * Replace all # characters in $string with a random digit.
     *
     * @param string $string
     * @return string
     */
    public static function numerify($string)
    {
        return preg_replace('/#/e', 'rand(0,9)', $string);
    }

    /**
     * Replace all ? characters in $string with a random char (a-z).
     *
     * @param string $string
     * @return string
     */
    public static function letterify($string)
    {
        return preg_replace('/\?/e', 'chr(rand(97,122))', $string);
    }

    /**
     * Return the combined result of letterify() and numerify().
     *
     * @param string $string
     * @return string
     */
    public static function bothify($string)
    {
        return static::letterify(static::numerify($string));
    }
}

<?php
namespace KDambekalns\Faker;

/*                                                                        *
 * This script belongs to the Flow package "Faker".                       *
 *                                                                        */

/**
 * Faker class for the Faker package
 *
 * The Faker package is based on http://faker.rubyforge.org/
 */
class Faker
{
    /**
     * Replace all # characters in $string with a random digit.
     *
     * @param string $string
     * @return string
     */
    public static function numerify($string)
    {
        return preg_replace_callback('/#/', function() { return rand(0,9); }, $string);
    }

    /**
     * Replace all ? characters in $string with a random char (a-z).
     *
     * @param string $string
     * @return string
     */
    public static function letterify($string)
    {
        return preg_replace_callback('/\?/', function() { return chr(rand(97,122)); }, $string);
    }

    /**
     * Return the combined result of letterify() and numerify().
     *
     * @param string $string
     * @return string
     */
    public static function bothify($string)
    {
        return static::letterify(static::numerify($string));
    }
}

Fix deprecated e modifier in preg_replace
BUGFIX: Fix deprecated e modifier in preg_replace

With PHP 7, Faker issued the following warning:
preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
