cvs: ZendEngine2 /tests int_overflow_64bit.phpt int_underflow_64bit.phpt

From: Date: Thu, 28 Sep 2006 12:08:44 +0000
Subject: cvs: ZendEngine2 /tests int_overflow_64bit.phpt int_underflow_64bit.phpt
Groups: php.zend-engine.cvs 
Request: Send a blank email to php-zend-engine-cvs+get-5280@lists.php.net to get a copy of this message
tony2001 Thu Sep 28 12:08:44 2006 UTC Modified files: /ZendEngine2/tests int_overflow_64bit.phpt int_underflow_64bit.phpt Log: new tests http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/int_overflow_64bit.phpt?r1=1.1&r2=1.2&diff_format=u Index: ZendEngine2/tests/int_overflow_64bit.phpt diff -u /dev/null ZendEngine2/tests/int_overflow_64bit.phpt:1.2 --- /dev/null Thu Sep 28 12:08:44 2006 +++ ZendEngine2/tests/int_overflow_64bit.phpt Thu Sep 28 12:08:44 2006 @@ -0,0 +1,29 @@ +--TEST-- +testing integer overflow (64bit) +--SKIPIF-- +<?php if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only"); ?> +--FILE-- +<?php + +$doubles = array( + 9223372036854775808, + 9223372036854775809, + 9223372036854775818, + 9223372036854775908, + 9223372036854776808, + ); + +foreach ($doubles as $d) { + $l = (int)$d; + var_dump($l); +} + +echo "Done\n"; +?> +--EXPECTF-- +int(-9223372036854775808) +int(-9223372036854775808) +int(-9223372036854775808) +int(-9223372036854775808) +int(-9223372036854775808) +Done http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/int_underflow_64bit.phpt?r1=1.1&r2=1.2&diff_format=u Index: ZendEngine2/tests/int_underflow_64bit.phpt diff -u /dev/null ZendEngine2/tests/int_underflow_64bit.phpt:1.2 --- /dev/null Thu Sep 28 12:08:44 2006 +++ ZendEngine2/tests/int_underflow_64bit.phpt Thu Sep 28 12:08:44 2006 @@ -0,0 +1,29 @@ +--TEST-- +testing integer underflow (64bit) +--SKIPIF-- +<?php if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only"); ?> +--FILE-- +<?php + +$doubles = array( + -9223372036854775808, + -9223372036854775809, + -9223372036854775818, + -9223372036854775908, + -9223372036854776808, + ); + +foreach ($doubles as $d) { + $l = (int)$d; + var_dump($l); +} + +echo "Done\n"; +?> +--EXPECTF-- +int(-9223372036854775808) +int(-9223372036854775808) +int(-9223372036854775808) +int(-9223372036854775808) +int(-9223372036854775808) +Done

« previous php.zend-engine.cvs (#5280) next »