Bug #79454 [NEW]: Transliterator::getErrorMessage is non-static and unusable for error checking

From: Date: Tue, 07 Apr 2020 08:53:54 +0000
Subject: Bug #79454 [NEW]: Transliterator::getErrorMessage is non-static and unusable for error checking
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-226446@lists.php.net to get a copy of this message
From: glen at pld-linux dot org Operating system: Irrelevant PHP version: 7.4.4 Package: *General Issues Bug Type: Bug Bug description:Transliterator::getErrorMessage is non-static and unusable for error checking Description: ------------ the https://www.php.net/manual/en/transliterator.geterrormessage.php is described to be called as static method, but it is not declared static and therefore can't be used why Transliterator::createFromRules for example failed. and transliterator_get_error_message() method won't help either, as it wants an transit object as argument, but I have none as it failed to be created. example with class method: ➔ php74 -n -r 'var_dump(Transliterator::createFromRules("Any-Latin")); var_dump(Transliterator::getErrorMessage());' NULL Fatal error: Uncaught Error: Non-static method Transliterator::getErrorMessage() cannot be called statically in Command line code:1 Stack trace: #0 {main} thrown in Command line code on line 1 example with procedural mode: ➔ php74 -n -r 'var_dump(Transliterator::createFromRules("Any-Latin")); var_dump(transliterator_get_error_message());' NULL Warning: transliterator_get_error_message() expects exactly 1 parameter, 0 given in Command line code on line 1 bool(false) Test script: --------------- var_dump(Transliterator::getErrorMessage()); Expected result: ---------------- Transliterator::createFromRules should perhaps throw, as there's no other way to pass error -- Edit bug report at https://bugs.php.net/bug.php?id=79454&edit=1 -- Fix committed: https://bugs.php.net/fix.php?id=79454&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=79454&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=79454&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=79454&r=needscript Try newer version: https://bugs.php.net/fix.php?id=79454&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=79454&r=support Expected behavior: https://bugs.php.net/fix.php?id=79454&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=79454&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=79454&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=79454&r=globals PHP version support discontinued: https://bugs.php.net/fix.php?id=79454&r=phptooold Daylight Savings: https://bugs.php.net/fix.php?id=79454&r=dst IIS Stability: https://bugs.php.net/fix.php?id=79454&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=79454&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=79454&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=79454&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=79454&r=mysqlcfg

« previous php.bugs (#226446) next »