How to unbox object in Phalanger ?
2 posts
• Page 1 of 1
How to unbox object in Phalanger ?
Phalanger Code:
1: function Read($hashtable) {
2: $h = $hashtable["key"];
3: $m = $h["message"];
4: }
C# Code:
Hashtable t1 = new Hashtable();
Hashtable t2 = new Hashtable();
t1.Add(t2);
Read(t1);
then I got exception on line 3.
I traced local variable and found the type of $h is {System.Collections.Hashtable}, but the type of $m is
object{System.Collections.Hashtable}. Obviously $m was
boxed, so how can I unbox it in Phalanger ?
1: function Read($hashtable) {
2: $h = $hashtable["key"];
3: $m = $h["message"];
4: }
C# Code:
Hashtable t1 = new Hashtable();
Hashtable t2 = new Hashtable();
t1.Add(t2);
Read(t1);
then I got exception on line 3.
I traced local variable and found the type of $h is {System.Collections.Hashtable}, but the type of $m is
object{System.Collections.Hashtable}. Obviously $m was
boxed, so how can I unbox it in Phalanger ?
- lucaslynn
- Posts: 1
- Joined: February 22nd, 2012, 8:42 am
Re: How to unbox object in Phalanger ?
There was a bug in accessing items of IList or IDictionary CLR objects, if the item is another non-PHP object.
Thanks! The fix will be available in upcoming release.
Thanks! The fix will be available in upcoming release.
Jakub Misek │ DEVSENSE s.r.o. | @misekjakub │ jakub@devsense.com │
-
Jakub Misek - Posts: 2092
- Joined: January 4th, 2012, 2:42 pm
- Location: Prague
2 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 5 guests