jeff00seattle wrote:Agreed, PHP does not have address pointers in the sense of C++; however, calling new returns an instance of an object in the heap.
It returns what they call a handle as of PHP5. Thinking of it as a pointer or pondering how or where it is stored will only get you in trouble in PHP. It's more magical like a file handle than a pointer.
jeff00seattle wrote:So, following the Hungarian-notation, what would be in PHP the most appropriate prefix to a variable to indicate it contains an instance of a Class?
I think most PHP programmers name object something objecty like $person and strings something stringy like $name. Variable type is not strict in PHP so all variables are either objects, strings or arrays. Numbers of various sorts get converted back and forth to/from strings on the fly depending on context.
jeff00seattle wrote:#2. No camel-case and Yes hungarian-notation
Not OK?
Yes OK?
Either is fine with me, just be consistent. You don't need the "str" on either because, as I said, all scalars are essentially strings.