New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

List.hx PHP #6859

Closed
JeremyGiner opened this Issue Feb 19, 2018 · 2 comments

Comments

Projects
None yet
2 participants
@JeremyGiner

JeremyGiner commented Feb 19, 2018

Following code throw the exception 'BUG' in PHP. Works fine in JS

class Test {

	static function main(){
		var l = new List<Int>();
		var iLength = 0;
		
		l.add( 42 );
		iLength++;
		
		l.add( 42 );
		iLength++;
		
		l.pop();
		iLength--; if ( iLength < 0 ) iLength = 0;
		
		l.add( 42 );
		iLength++;
		
		l.pop();
		iLength--; if ( iLength < 0 ) iLength = 0;
		
		l.pop();
		iLength--; if ( iLength < 0 ) iLength = 0;
		
		if ( iLength != l.length ) 
			throw('BUG');
		else
			trace('no bug');
	}
}
@RealyUniqueName

This comment has been minimized.

Member

RealyUniqueName commented Feb 20, 2018

Which Haxe version are you building this sample with?
Are you using -D php7 flag?

@JeremyGiner

This comment has been minimized.

JeremyGiner commented Feb 20, 2018

i'm using php 5.6.31
haxe 3.4.4

the builder is very classic :

# Select directory
-cp src

# php target
-php build\test
--php-front index.php

-main test.Test

RealyUniqueName pushed a commit that referenced this issue Feb 20, 2018

Alexander Kuzmenko Alexander Kuzmenko
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment