Browse Source

ensure that [Enum(x)].toString() works correctly on Php (fixed issue #913)

Simon Krajewski 13 years ago
parent
commit
6e8016709e
2 changed files with 3 additions and 1 deletions
  1. 1 1
      std/php/Boot.hx
  2. 2 0
      tests/unit/TestBasetypes.hx

+ 1 - 1
std/php/Boot.hx

@@ -121,7 +121,7 @@ class _hx_array implements ArrayAccess, IteratorAggregate {
 	}
 
 	function toString() {
-		return '['.implode(',', $this->»a).']';
+		return '['.implode(',', array_map('_hx_string_rec',$this->»a,array())).']';
 	}
 
 	function __toString() {

+ 2 - 0
tests/unit/TestBasetypes.hx

@@ -119,6 +119,8 @@ class TestBasetypes extends Test {
 		
 		var e = MyEnum.C(0, "h");
 		eq( Std.string(e), "C(0,h)");
+		
+		eq(Std.string([e]), "[C(0,h)]");
 	}
 
 	function testMath() {