Bug #65055 [NEW]: new Operator shuld never return a NULL new ResourceBundle
| From: | goetas at lignano dot it | Date: | Tue, 18 Jun 2013 07:59:01 +0000 |
| Subject: | Bug #65055 [NEW]: new Operator shuld never return a NULL new ResourceBundle | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-179607@lists.php.net to get a copy of this message | ||
From: goetas at lignano dot it
Operating system: ubuntu 12.04
PHP version: 5.4.16
Package: I18N and L10N related
Bug Type: Bug
Bug description:new Operator shuld never return a NULL new ResourceBundle
Description:
------------
sapi/cli/php -v
PHP 5.4.16 (cli) (built: Jun 18 2013 09:34:40)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies
Instantiating ResourceBundle class, a "new" operator should never return
null.
http://php.net/manual/en/language.oop5.basic.php#language.oop5.basic.new
"To create an instance of a class, the new keyword must be used. An object
will always be created unless the object has a constructor defined that
throws an exception on error."
This behaviour it's also verified by Symfony team
https://github.com/symfony/Intl/blob/master/ResourceBundle/Reader/BinaryBundleReader.php
Test script:
---------------
sapi/cli/php -r 'var_dump(new \ResourceBundle("ANY WRONG PATH",
"it"));'
Expected result:
----------------
Thrown some exception
Actual result:
--------------
NULL
--
Edit bug report at https://bugs.php.net/bug.php?id=65055&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=65055&r=trysnapshot54
Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=65055&r=trysnapshot53
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=65055&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=65055&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=65055&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=65055&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=65055&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=65055&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=65055&r=support
Expected behavior: https://bugs.php.net/fix.php?id=65055&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=65055&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=65055&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=65055&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=65055&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=65055&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=65055&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=65055&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=65055&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=65055&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=65055&r=mysqlcfg