|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #56905 Allow non-scalar constants to be defined and loaded
Submitted: 2006-03-21 09:08 UTC Modified: 2006-08-21 15:57 UTC
From: yonman at nsa dot co dot il Assigned:
Status: Not a bug Package: APC (PECL)
PHP Version: Irrelevant OS: Any
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 this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: yonman at nsa dot co dot il
New email:
PHP Version: OS:


 [2006-03-21 09:08 UTC] yonman at nsa dot co dot il
After integrating APC into my code I was surprised to find out that only scalar definitions can be stored and retrieved with APC's apc_load_constants and apc_define_constants.

If this limitation(?) can be lifted, it would allow the implementation of interesting i18n schemes and other templating solutions.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2006-03-21 09:44 UTC] gopalv82 at yahoo dot com
are you saying that you want constant arrays dumped into APC via this code path ?

There should be other more easier ways than going to all this trouble to cache it in shared mem.
 [2006-03-21 09:47 UTC] yonman at nsa dot co dot il
Well, seemed reasonable since this is already done in APC, but limited to scalars. I'm guessing this limitation is there to protect the programmer from doing exactly I want to do... but shouldn't I at least have a choice?
 [2006-08-21 15:57 UTC] gopalv82 at yahoo dot com
From the php manual: 

  You can define a constant by using the define()-function.
  Only scalar data (boolean, integer, float and string) can 
  be contained in constants.

There's no point, the language doesn't support non-scalar constants.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Jul 18 08:01:28 2024 UTC