[Geany-devel] tagmanager related questions

Enrico Tröger enrico.troeger at xxxxx
Tue Jan 18 22:18:09 UTC 2011


On Tue, 18 Jan 2011 20:35:33 +0100, Colomban wrote:

>Le 18/01/2011 20:15, Enrico Tröger a écrit :
>> On Tue, 18 Jan 2011 15:22:48 +0300, Константин wrote:
>> 
>> […]
>>>
>>> Now we have such php code:
>>> <?php
>>>
>>> class test1{
>>> 	var $abc;var $test;
>>> 	function test567(){
>>> 		echo "{$a}";
>>> 		echo '{$a1}';
>>> 	}
>>> 	
>>> }
>>>
>>> $hello=new test1();
>>>
>>> ?>
>>>
>>> so questions: 
>>> 1) is i am right that varType of $hello must be test1? so varType is
>>> the type of variable?
>> 
>> Nope. varType is the type of the variable, e.g. string, integer,
>> list, etc. As far as I know PHP doesn't use strict typing at all, so
>> it's probably best to leave it at NULL.
>Well, you are right that PHP variable types are not strict, but in this
>case it is true that $hello has type "test1", so perhaps it's goodt to

True.
Sorry for my mistake. I didn't read the example carefully enough.
But as you also pointed out below, PHP is not strictly typed and so
using the varType field is probably not useful or at least very hard to
be used correctly in complex code samples.


>set it to this value. However, setting it to another value later in the
>code would be perfectly valid, and so keeping the type "test1" would be
>wrong:
>
>$hello = new Test()
>$hello = 42


Regards,
Enrico

-- 
Get my GPG key from http://www.uvena.de/pub.asc
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.geany.org/pipermail/devel/attachments/20110118/27bf4081/attachment.pgp>


More information about the Devel mailing list