How to unbox object in Phalanger ?

Discussion about the open-source Phalanger [?] project.

How to unbox object in Phalanger ?

Postby lucaslynn » February 22nd, 2012, 8:52 am

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 ?
lucaslynn
 
Posts: 1
Joined: February 22nd, 2012, 8:42 am

Re: How to unbox object in Phalanger ?

Postby Jakub Misek » February 22nd, 2012, 12:29 pm

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.
Jakub Misek │ DEVSENSE s.r.o. | @misekjakubjakub@devsense.com
User avatar
Jakub Misek
 
Posts: 2092
Joined: January 4th, 2012, 2:42 pm
Location: Prague


Return to Phalanger project

Who is online

Users browsing this forum: No registered users and 5 guests

User Control Panel

Login

Who is online

In total there are 5 users online :: 0 registered, 0 hidden and 5 guests (based on users active over the past 5 minutes)
Most users ever online was 787 on May 12th, 2024, 11:50 am

Users browsing this forum: No registered users and 5 guests