|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2011-11-22 10:10 UTC] laruence@php.net
[2011-11-22 10:11 UTC] laruence@php.net
[2011-11-22 10:11 UTC] laruence@php.net
-Status: Open
+Status: Closed
-Assigned To:
+Assigned To: laruence
[2012-04-18 09:47 UTC] laruence@php.net
[2012-07-24 23:38 UTC] rasmus@php.net
[2013-11-17 09:35 UTC] laruence@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 14:00:01 2025 UTC |
Description: ------------ When a function defines an array parameter with a default value, the __toString() method of the ReflectionParameter class will trigger an E_NOTICE. See the attached test script. Test script: --------------- <?php function foo( array $x = array( 'a', 'b' ) ) {} $r = new ReflectionParameter( 'foo', 0 ); var_dump( $r->__toString() ); Expected result: ---------------- string(44) "Parameter #0 [ <optional> array $x = Array ]" Actual result: -------------- PHP Notice: Array to string conversion in /tmp/ref.php on line 5 PHP Stack trace: PHP 1. {main}() /tmp/ref.php:0 PHP 2. ReflectionParameter->__toString() /tmp/ref.php:5 Notice: Array to string conversion in /tmp/ref.php on line 5 Call Stack: 0.0002 230464 1. {main}() /tmp/ref.php:0 0.0002 231488 2. ReflectionParameter->__toString() /tmp/ref.php:5 string(44) 'Parameter #0 [ <optional> array $x = Array ]'