Bug #67709 [NEW]: Error calling static function on array declaration

From: Date: Tue, 29 Jul 2014 14:40:55 +0000
Subject: Bug #67709 [NEW]: Error calling static function on array declaration
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-186864@lists.php.net to get a copy of this message
From: simonettigo at gmail dot com Operating system: Ubuntu 12.10 PHP version: 5.6.0RC2 Package: Scripting Engine problem Bug Type: Bug Bug description:Error calling static function on array declaration 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 -- Edit bug report at https://bugs.php.net/bug.php?id=67709&edit=1 --

« previous php.bugs (#186864) next »