|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2020-04-07 08:53 UTC] glen at pld-linux dot org
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 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 13:00:02 2025 UTC |
@requinix, I the arginfo looks correct (PHP 7.3): D:\Users\cmb>php --rf transliterator_get_error_code Function [ <internal:intl> function transliterator_get_error_code ] { - Parameters [1] { Parameter #0 [ <required> Transliterator $trans ] } } D:\Users\cmb>php --rf transliterator_get_error_message Function [ <internal:intl> function transliterator_get_error_message ] { - Parameters [1] { Parameter #0 [ <required> Transliterator $trans ] } }