Bug #80073 [NEW]: levenshthein(): warning/error not documented

From: Date: Mon, 07 Sep 2020 09:38:16 +0000
Subject: Bug #80073 [NEW]: levenshthein(): warning/error not documented
Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-17868@lists.php.net to get a copy of this message
From:             claude dot pache at gmail dot com
Operating system: 
PHP version:      Irrelevant
Package:          Documentation problem
Bug Type:         Bug
Bug description:levenshthein(): warning/error not documented

Description:
------------
In the manual page:

https://www.php.net/manual/function.levenshtein.php

it is stated that levenshtein() returns -1 if one argument is too long,
but it doesn’t say that an error is emitted.

Test script:
---------------
var_dump(levenshtein(str_repeat('X', 300), 'a'));

Expected result:
----------------
Per the manual page; dumps -1 without warning/error.

Actual result:
--------------
In PHP 7: Emits a Warning and dumps -1.

In PHP 8: Throws a ValueError.

-- 
Edit bug report at https://bugs.php.net/bug.php?id=80073&edit=1
-- 
Fix committed:                    https://bugs.php.net/fix.php?id=80073&r=fixed
Fixed in release:                 https://bugs.php.net/fix.php?id=80073&r=alreadyfixed
Need backtrace:                   https://bugs.php.net/fix.php?id=80073&r=needtrace
Need Reproduce Script:            https://bugs.php.net/fix.php?id=80073&r=needscript
Try newer version:                https://bugs.php.net/fix.php?id=80073&r=oldversion
Not developer issue:              https://bugs.php.net/fix.php?id=80073&r=support
Expected behavior:                https://bugs.php.net/fix.php?id=80073&r=notwrong
Not enough info:                  https://bugs.php.net/fix.php?id=80073&r=notenoughinfo
Submitted twice:                  https://bugs.php.net/fix.php?id=80073&r=submittedtwice
register_globals:                 https://bugs.php.net/fix.php?id=80073&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=80073&r=phptooold
Daylight Savings:                 https://bugs.php.net/fix.php?id=80073&r=dst
IIS Stability:                    https://bugs.php.net/fix.php?id=80073&r=isapi
Install GNU Sed:                  https://bugs.php.net/fix.php?id=80073&r=gnused
Floating point limitations:       https://bugs.php.net/fix.php?id=80073&r=float
No Zend Extensions:               https://bugs.php.net/fix.php?id=80073&r=nozend
MySQL Configuration Error:        https://bugs.php.net/fix.php?id=80073&r=mysqlcfg


Thread (4 messages)

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