Req #73204 [Com]: Wrong runtime type error raised.

From: Date: Sat, 01 Oct 2016 06:46:31 +0000
Subject: Req #73204 [Com]: Wrong runtime type error raised.
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-204385@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=73204&edit=1 ID: 73204 Comment by: a at b dot c dot de Reported by: tomasyorke at hotmail dot com Summary: Wrong runtime type error raised. Status: Not a bug Type: Feature/Change Request Package: *General Issues Operating System: Irrelevant PHP Version: 7.0.11 Block user comment: N Private report: N New Comment: And passing a function more arguments than it has parameters is legal (see http://www.php.net/manual/functions.arguments.php#functions.variable-arg-list "variadic functions" for why). Previous Comments: ------------------------------------------------------------------------ [2016-09-30 00:37:15] yohgaki@php.net It seems this is what you want. https://3v4l.org/baMcl If you still see issue, please reopen. ------------------------------------------------------------------------ [2016-09-29 22:25:44] tomasyorke at hotmail dot com Description: ------------ myFunction() returns an array. myFunction($i)->Data(); Returns the error: Fatal error: Uncaught Error: Call to a member function Data() on array Test script: --------------- function myFunction(){ return Array(new A,new A); } class A { public $foo = 1; function Data(){ return 5; } } five = myFunction(1)->Data() Expected result: ---------------- It should Return that myFunction takes no parameters. ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=73204&edit=1

« previous php.bugs (#204385) next »