PHP 5.5 compatibility issue (deprecated notice)

in Product Factory Class, for PHP 5.3+ (use core constant PHP_VERSION_ID
available form PHP 5.2.7 to check ), when closures were available,  use
preg_replace_callback instead of preg_replace with /e modifier because
it is deprecated in PHP 5.5.