Bug #80531 [NEW]: Crash in mysqlnd_fetch_stmt_row_cursor when calling an SP with a cursor

From: Date: Fri, 18 Dec 2020 09:43:02 +0000
Subject: Bug #80531 [NEW]: Crash in mysqlnd_fetch_stmt_row_cursor when calling an SP with a cursor
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-231148@lists.php.net to get a copy of this message
From:             rh at tfli dot co dot uk
Operating system: Windows 10 (64Bit)
PHP version:      8.0.0
Package:          Scripting Engine problem
Bug Type:         Bug
Bug description:Crash in mysqlnd_fetch_stmt_row_cursor when calling an SP with a cursor

Description:
------------
This might be expected behaviour, but if so, should be made clear in the
migration guide and/or the function page.

Since upgrading to PHP8, then an unchanged call to call_user_func_array
in an existing project was returning the error 'Uncaught Error: Cannot
use positional argument after named argument'. Investigating it further,
one of the arguments is de-serialised from a JSON object (and so the
array has string keys).

While I can see the behaviour of call_user_func_array using string
keys as named arguments being useful, I can also see it being a massive
'gotta' for people when upgrading, especially as it is not currently
documented anywhere that this will be the case (a lot of the times this
can happen the array internal structure won't be apparent from the code
or the error message).

Test script:
---------------
<?php
var_dump(call_user_func_array("strlen", ["hello"]));
var_dump(call_user_func_array("strlen", ["a" => "hello"]));

// Version Comparison: https://3v4l.org/c1R03

Expected result:
----------------
int(5)
int(5)

Actual result:
--------------
int(5)

Fatal error: Uncaught Error: Unknown named parameter $a in /in/c1R03:3
Stack trace:
#0 {main}
  thrown in /in/c1R03 on line 3

Process exited with code 255.

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


Thread (1 message)

  • rh at tfli dot co dot uk
« previous php.bugs (#231148) next »