#49161 [Opn->Asn]: Got null upon the MessageFormatter() class instantiation with empty pattern.

From: Date: Wed, 05 Aug 2009 07:48:44 +0000
Subject: #49161 [Opn->Asn]: Got null upon the MessageFormatter() class instantiation with empty pattern.
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-2610@lists.php.net to get a copy of this message
ID: 49161 Updated by: jani@php.net Reported By: maximgb at yandex dot ru -Status: Open +Status: Assigned Bug Type: *Languages/Translation -Operating System: Windows XP SP2 +Operating System: * -PHP Version: 5.3.0 +PHP Version: 5.*, 6 (2009-08-05) -Assigned To: +Assigned To: stas New Comment: Apparently you must pass it at least 1 char pattern. Empty string isn't one. Not sure if this is intentional, Stas? Previous Comments: ------------------------------------------------------------------------ [2009-08-05 00:29:02] maximgb at yandex dot ru Description: ------------ I've tryed to create the MessageFormatter class, from intl extension, passing an empty string for the constructor's second argument and I was pretty surprised to get NULL instead of object instance :) Reproduce code: --------------- $f = new MessageFormatter(Locale::getDefault(), ''); var_dump($f, is_object($f)); $f = MessageFormatter::create(Locale::getDefault(), ''); var_dump($f, is_object($f)); Expected result: ---------------- object(MessageFormatter)#1 (0) { } bool(true) object(MessageFormatter)#2 (0) { } bool(true) Actual result: -------------- NULL bool(false) NULL bool(false) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=49161&edit=1

« previous php.doc.bugs (#2610) next »