php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #55829 impossible to define a variable S_ALL
Submitted: 2011-10-02 00:24 UTC Modified: 2011-10-02 13:28 UTC
Votes:1
Avg. Score:1.0 ± 0.0
Reproduced:0 of 1 (0.0%)
From: cizek dot milan at seznam dot cz Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 5.3.8 OS: FreeBSD 8.0-RELEASE
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: cizek dot milan at seznam dot cz
New email:
PHP Version: OS:

 

 [2011-10-02 00:24 UTC] cizek dot milan at seznam dot cz
Description:
------------
---
From manual page: http://www.php.net/function.define
---

I searched in predefined S_ALL constants and variables, but I did not find anything.

Test script:
---------------
<?php
  define (S_ALL, 'All');
  echo S_ALL;
?>

Expected result:
----------------
511


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-10-02 04:15 UTC] laruence@php.net
what do you mean by impossible to define a S_ALL?
 
<?php
define ("S_ALL", "511");
echo S_ALL;
?>

this works fine to  me.
 [2011-10-02 04:15 UTC] laruence@php.net
-Status: Open +Status: Feedback
 [2011-10-02 04:15 UTC] laruence@php.net
what do you mean by impossible to define a S_ALL?
 
<?php
define ("S_ALL", "511");
echo S_ALL;
?>

this works fine to  me.
 [2011-10-02 12:50 UTC] cizek dot milan at seznam dot cz
-Status: Feedback +Status: Open
 [2011-10-02 12:50 UTC] cizek dot milan at seznam dot cz
When I assign any value to S_ALL, the value is always 511. Example script...

<?php
define (S_ALL,'Hi');
echo S_ALL;  //511
define (S_ALL,'asd');
echo S_ALL;  //511
?>

FreeBSD 8.0-RELEASE-p3 #0, with php5-5.3.8
 [2011-10-02 13:03 UTC] johannes@php.net
-Status: Open +Status: Bogus
 [2011-10-02 13:03 UTC] johannes@php.net
Somewhere else you already have defined S_ALL. So what you are doing is to register a constant using the value of S_ALL as name.  So will have a constant 511.

Try this:

define (S_ALL, 'All');
echo constant("511");

When declaring a constant the first paramter has to be a string with the name, so put it in quites.

define ('S_ALL', 'All');

Will give you an error.

The palce where S_ALL, most likely, is being defined is in the suhoshin extension your system seems to use.
 [2011-10-02 13:15 UTC] cizek dot milan at seznam dot cz
Yes, you're right.
S_ALL defined in Suhosin-patch (5.3.8-0.9.10), in the file zend_errors.h.diff

 + # define S_ALL (S_MEMORY | S_VARS | S_INCLUDE | S_FILES | S_MAIL | S_SESSION | S_MISC | S_SQL | S_EXECUTOR)

this is the cause? Thanks.
 [2011-10-02 13:28 UTC] pajoye@php.net
Yet another reason not to use this patch. Also please report bugs only when you 
tested it without a patched version of PHP. We cannot provide support for patched 
version of PHP.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sun Jul 13 20:01:33 2025 UTC