Browse Source

php: fixed Array.push must return the current length

Franco Ponticelli 15 years ago
parent
commit
bb44edf16b
2 changed files with 2 additions and 1 deletions
  1. 1 0
      doc/CHANGES.txt
  2. 1 1
      std/php/Boot.hx

+ 1 - 0
doc/CHANGES.txt

@@ -8,6 +8,7 @@
 	flash9 : fixed TypedDictionary.exists
 	flash9 : fixed TypedDictionary.exists
 	all : added @:build for enums
 	all : added @:build for enums
 	neko : Std.parseFloat now returns NaN with invalid string
 	neko : Std.parseFloat now returns NaN with invalid string
+	php: fixed Array.push must return the current length
 
 
 2010-08-14: 2.06
 2010-08-14: 2.06
 	neko : change serializer to be able to handle instances of basic classes from other modules
 	neko : change serializer to be able to handle instances of basic classes from other modules

+ 1 - 1
std/php/Boot.hx

@@ -69,7 +69,7 @@ class _hx_array implements ArrayAccess, IteratorAggregate {
 
 
 	function push($x) {
 	function push($x) {
 		$this->»a[] = $x;
 		$this->»a[] = $x;
-		$this->length++;
+		return ++$this->length;
 	}
 	}
 
 
 	function remove($x) {
 	function remove($x) {