So in C# I create something like
private const int HEADER_LENGTH = 13;
private const byte SIGNATURE1 = 0x46;
How to create its analog in PHP?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
No. The closest things are:
which is not private and
which is not final. You cannot also constrict the type of the variable. There is also no 1-byte type in PHP – you should use an integer for that or a string with length 1.
You can implement something like that internally by overriding the
get_property_ptr_ptrandwrite_propertyobject handlers, but not with only PHP.