|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2014-07-29 16:21 UTC] requinix@php.net
-Status: Open
+Status: Not a bug
[2014-07-29 16:21 UTC] requinix@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 10 00:00:01 2026 UTC |
Description: ------------ Calling a static function inside an array declaration provides a syntax error. Test script: --------------- class Foo{ static function hello(){ echo "Hello world!"; } } class Bar{ public $message = array( 'foo' => Foo::hello() ); } $Bar = new Bar(); echo $bar->message['foo']; Expected result: ---------------- Hello world! Actual result: -------------- Fatal error: syntax error, unexpected '(', expecting ')' in php shell code on line 9