|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2014-12-24 20:58 UTC] aharvey@php.net
-Status: Open
+Status: Not a bug
[2014-12-24 20:58 UTC] aharvey@php.net
[2014-12-24 22:27 UTC] najamelan at autistici dot org
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 06 20:00:02 2026 UTC |
Description: ------------ I'm sorry, I could only test this on 5.6.2-1 (debian) but it's very fast to verify for someone who has the latest version installed, see script below. Test script: --------------- <?php // php version 5.6.2-1 -> on debian const BLA = 1; class Test { const BLI = BLA * 5; // works on cli and crashes the interpreter on cgi (internal server error 500) // const BLI = 3 * 5; -> works fine on both cgi and cli but illegal according to the docs // https://wiki.php.net/rfc/const_scalar_exprs is said to be implemented in 5.6 // but neither the language specs nor the documentation reflect this. function __construct() { print_r( self::BLI ); // the interpreter only crashes when trying to access the constant } } new Test(); ?> Expected result: ---------------- 1. under no circumstance ever cause internal server 500 error (debugging nightmare) 2. update specs and docs Actual result: -------------- 500 in apache nothing in php error log