#49828 [Com]: class-constant can't be set to negative infinity

From: Date: Sat, 10 Oct 2009 11:46:46 +0000
Subject: #49828 [Com]: class-constant can't be set to negative infinity
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-143437@lists.php.net to get a copy of this message
ID: 49828 Comment by: daniel dot meister at datahouse dot ch Reported By: daniel dot meister at datahouse dot ch Status: Open Bug Type: Class/Object related Operating System: Ubuntu 09.04 PHP Version: 5.2.11 New Comment: possible workarounds: define("C",-INF); class A { const a = C; } class A { const a = -1E100000000; } Previous Comments: ------------------------------------------------------------------------ [2009-10-10 00:44:03] daniel dot meister at datahouse dot ch Description: ------------ It is not possible to set a class-constant to the value of negative infinity (-INF) while it is possible to set it to any float value or even to positive infinity (INF) or not-a-number (NAN). configuration: - no configure options - no changes to php.ini Reproduce code: --------------- class A { const a = -INF; } echo is_infinite(A::a); Expected result: ---------------- 1 Actual result: -------------- Fatal error: Unsupported operand types in /path/to/file/filename.php on line n ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=49828&edit=1

« previous php.bugs (#143437) next »