Bug #68177 [NEW]: declare() + named constant = "Cannot convert to ordinal value"
| From: | mikko dot rantalainen at peda dot net | Date: | Tue, 07 Oct 2014 13:17:28 +0000 |
| Subject: | Bug #68177 [NEW]: declare() + named constant = "Cannot convert to ordinal value" | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-187915@lists.php.net to get a copy of this message | ||
From: mikko dot rantalainen at peda dot net
Operating system: Ubuntu Linux 10.04 LTS
PHP version: 5.6.1
Package: Compile Warning
Bug Type: Bug
Bug description:declare() + named constant = "Cannot convert to ordinal value"
Description:
------------
The declare construct raises a warning "Cannot convert to ordinal value"
if a named constant is used as a parameter. If this is intentional
limitation, it should be documented. Otherwise, this is a bug.
Test case at http://3v4l.org/YFZ4D
Test script:
---------------
<?php
define("CONFIG_TICKS", 1);
declare(ticks=CONFIG_TICKS);
$x = "test";
Expected result:
----------------
The declared value of 'ticks' should be 1 and the script should emit no
output.
Actual result:
--------------
Warning: Cannot convert to ordinal value in /in/YFZ4D on line 3
--
Edit bug report at https://bugs.php.net/bug.php?id=68177&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=68177&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=68177&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=68177&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=68177&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=68177&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=68177&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=68177&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=68177&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=68177&r=support
Expected behavior: https://bugs.php.net/fix.php?id=68177&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=68177&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=68177&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=68177&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=68177&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=68177&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=68177&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=68177&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=68177&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=68177&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=68177&r=mysqlcfg