Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 158 Stack Exchange communities.

What is meta?
Here's how it works:
  1. Any Stack Exchange user can ask a question
  2. The community provides support, votes on ideas, and reports bugs
  3. Your voice helps shape the way Stack Exchange operates

In PHP a property declaration

may include an initialization, but this initialization must be a constant value--that is, it must be able to be evaluated at compile time and must not depend on run-time information in order to be evaluated.

As a consequence, you cannot assign lambdas, closures, new instances, function returns or expressions. While explained in the PHP Manual, we already have a number of duplicates asking for either of those declarations. I wonder whether we could/should merge a few of those into a Canonical, maybe rephrasing the original question to accommodate for all the metioned cases above.

See the list Merging Candidates

share|improve this question
Sure, if a few of the tag regulars don't mind the little bit of cleanup that sometimes has to be done post merge, just flag the ones you want merged and indicate the target (that stays around after it's done) and point to this meta question. I'd like to see a discussion on which ones should be kept around, but this definitely needs a canonical reference. – Tim Post Feb 18 '12 at 13:46
@TimPost I already did for some that ask specifically about assigning new instances. However, since I had a merging request declined in the past with the reason: "the questions are not identical: this one covers a specific case with different code, and its answers would not fit well with the other question" I am uncertain which of the others would get accepted for merging. Hence the question here. I was hoping you Mods could go through the Candidate List and do it at your own discretion. – Gordon Feb 18 '12 at 14:00
I'm looking through them now, actually. What I'm looking for are the candidates for the 'best one to keep around', which basically asks which one is of good quality where answers from the others could slide in easily – Tim Post Feb 18 '12 at 14:10
@TimPost the ones I flagged got closed but not for some reason, they didnt get merged :( – Gordon Feb 20 '12 at 10:00
flags are still pending, we're taking a bit of a proverbial beating at the moment. – Tim Post Feb 20 '12 at 11:03

You must log in to answer this question.

Browse other questions tagged .