Release Notes

Dear Community,

On behalf of the Haxe Foundation I am proud to announce that Haxe 4.0.0-preview.2 is now officially released! It is available along with the changelog at

This release removes the old PHP target, which means Haxe is going to output only PHP7 from now on. Furthermore, we are removing some parts of the standard library. For easier transition, they are still available in this haxelib:

The major new feature of this release is the addition of the final keyword, which can be used in place of var for class fields. For static fields, it behaves like var name(default, never). For instance fields, it allows assignment to the variable only from the class constructor. Further refinements and documentation will follow.

There have also been, of course, various bugfixes. We will make an effort to have monthly preview releases for the remainder for 2017, and then move on to RC releases once we are happy with where Haxe 4 is.

Please test your Haxe code with this version and let us know if you come across any problems at

Thank you for your support

Change Log

2017-10-08: 4.0.0-preview.2

New features:

  • all : added final keyword (#6596)

General improvements and optimizations:

  • all : replaced some occurrences of List with Array
  • all : changed haxe.xml.Fast to an abstract
  • all : improved optimization when comparing against null
  • all : added support for case var x syntax and detect possible typos (#6608)
  • php : changed --php-prefix, --php-front and --php-lib to -D php-prefix=, -D php-front= and -D php-lib= respectively


  • all : moved haxe.unit to hx3compat
  • all : moved haxe.web.Request to hx3compat
  • php : dropped php5 support; minimum supported php version is 7.0 now


  • all : fixed issue with various functions not being displayed in macro context (#6000)
  • all : fixed invalid static extension lookup on super (#3607)
  • all : fixed typing error when constructing enums with abstracts over functions (#6609)
  • all : fixed bug that skipped checking @:from typing in some cases (#6564)
  • all : fixed Int64 parsing of negative numbers that end in a zero (#5493)
  • all : fixed top-down inference when constructing enums (#6606)
  • eval : fixed bug with equality handling
  • eval : fixed issue with file creation not defaulting to binary
  • eval : fixed invalid override detection (#6583)
  • eval : fixed infinite recursion when printing arrays/vectors
  • cs/java : fixed DCE bug that would lose toString method of thrown objects
  • php/python : fixed some bit operators for Int32 (#5938)
  • php : fixed accessing static inline var via reflection (#6630)
  • php : fixed Math.min() and Math.max() for NAN on PHP 7.1.9 and 7.1.10
  • js : fixed js syntax error for value.iterator-- (#6637)

Standard Library:

  • macro : added haxe.display.Position and PositionTools.toRange (#6599)
  • all : moved List to haxe.ds (#6610)