Browse Source

[php] fix stringification in Array.join() (fixes #7443)

Alexander Kuzmenko 7 years ago
parent
commit
ca6b4f3a05
2 changed files with 8 additions and 1 deletions
  1. 1 1
      std/php/_std/Array.hx
  2. 7 0
      tests/unit/src/unit/issues/Issue7443.hx

+ 1 - 1
std/php/_std/Array.hx

@@ -86,7 +86,7 @@ class Array<T> implements ArrayAccess<Int,T> {
 	}
 	}
 
 
 	public function join(sep:String):String {
 	public function join(sep:String):String {
-		return Global.implode(sep, Global.array_map('strval', arr));
+		return Global.implode(sep, Global.array_map(Syntax.nativeClassName(Boot) + '::stringify', arr));
 	}
 	}
 
 
 	public function lastIndexOf(x:T, ?fromIndex:Int):Int {
 	public function lastIndexOf(x:T, ?fromIndex:Int):Int {

+ 7 - 0
tests/unit/src/unit/issues/Issue7443.hx

@@ -0,0 +1,7 @@
+package unit.issues;
+
+class Issue7443 extends unit.Test {
+	function test () {
+		eq('true,false', [true, false].join(','));
+	}
+}