|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits              [2008-11-04 09:06 UTC] tularis@php.net
 | |||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 19:00:02 2025 UTC | 
Description: ------------ hello i think there is a logic problem with php's fields/properties initial values they can be only int float string boolean or null! please see the code thank you Reproduce code: --------------- class Config { private static $defaultLanguage = new Lang("en"); private static $objectsUrl = new Path("my/path/"); private static $look = new LookAndFeel("default"); } ------------------- the only way i can set initial static values is ------------------- class Config { private static $defaultLanguage; private static $objectsUrl; private static $look; public static __unbelievable_static_constructor() //!!!!!!! { self::$defaultLanguage = new Lang("en"); self::$objectsUrl = new Path("my/path/"); self::$look = new LookAndFeel("default"); } } Config::__unbelievable_static_constructor(); Actual result: -------------- unexpected NEW