php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #76979 define() error message does not mention resources as valid values
Submitted: 2018-10-05 22:24 UTC Modified: -
From: bugs dot php dot net at majkl578 dot cz Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 7.3.0RC2 OS: -
Private report: No CVE-ID: None
 [2018-10-05 22:24 UTC] bugs dot php dot net at majkl578 dot cz
Description:
------------
Resources are valid values for constants. This is also documented in php-langspec: https://github.com/php/php-langspec/blob/be010b4435e7b0801737bb66b5bbdd8f9fb51dde/spec/06-constants.md#constantsĀ§

Test script:
---------------
<?php

define('FOO', new stdClass());

Expected result:
----------------
Warning: Constants may only evaluate to scalar values, arrays or resources

Actual result:
--------------
Warning: Constants may only evaluate to scalar values or arrays

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2018-10-06 09:22 UTC] nikic@php.net
Automatic comment on behalf of me@majkl.me
Revision: http://git.php.net/?p=php-src.git;a=commit;h=0a6ddc77224f86cef4f08c662bd96ede11616c8e
Log: Fix bug #76979: define() error message does not mention resources as valid values
 [2018-10-06 09:22 UTC] nikic@php.net
-Status: Open +Status: Closed
 
PHP Copyright © 2001-2018 The PHP Group
All rights reserved.
Last updated: Wed Dec 12 08:01:25 2018 UTC