php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #57342 apc loaded constants don't appears in get_defined_constants
Submitted: 2006-11-04 05:20 UTC Modified: 2006-11-06 05:20 UTC
From: arnaud dot lb at gmail dot com Assigned:
Status: Closed Package: APC (PECL)
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
10 - 5 = ?
Subscribe to this entry?

 
 [2006-11-04 05:20 UTC] arnaud dot lb at gmail dot com
Description:
------------
Constants loaded with apc_load_constants are not shown in 
get_defined_constants

Reproduce code:
---------------
<?php

$constants = array(
    'ONE'  => 1,
    'TWO'  => 2,
    'THREE' => 3,
);
apc_define_constants('numbers', $constants);
apc_load_constants('numbers');
echo ONE, TWO, THREE;

echo "is 'ONE' defined ? " . (int) defined('ONE');

$constants = get_defined_constants(true);

echo "Defined constants: " .  count($constants['user']) . "\n";

print_r($constants['user']);

?>

Expected result:
----------------
123
is 'ONE' defined ? 1
Defined constants: 3
Array
(
    [ONE] => 1
    [TWO] => 2
    [THREE] => 3
)

Actual result:
--------------
123
is 'ONE' defined ? 1
Defined constants: 0
(print_r prints nothing here)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-11-06 04:52 UTC] gopalv82 at yahoo dot com
Fixed.

http://news.php.net/php.pecl.cvs/6596

Thanks for the bug report.
 [2006-11-06 05:20 UTC] arnaud dot lb at gmail dot com
Thanks :)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 09:01:26 2024 UTC