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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: arnaud dot lb at gmail dot com
New email:
PHP Version: OS:

 

 [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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Fri May 09 13:01:28 2025 UTC