Navigation : Forums > Problèmes > Were default property values always allowed?

Pages : 1 Poster un nouveau sujet Ajouter un message
Auteur Message
Rayancaleb

Messages : 76
Inscrit le : 12/09/2017
Posté le 23/09/2017 à 11:43:34 Message N°1 #
class foo {
// was this always allowed?
public $bar = 'abc default value';

// or did older versions only allow this?
public $bar;
}
I couldn't determine the answer to this question looking at documentation. I found some old code where no class had a default value. Maybe it was a developer preference, but I was wondering if older PHP versions didn't even allow default values?

Just a question of curiosity.
I didn't find the right solution from the internet.
References:

Product Video
Profil Citer

Navigation : Forums > Problèmes > Were default property values always allowed?

Pages : 1 Poster un nouveau sujet Ajouter un message


Se rendre directement sur le forum :