php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #55411 undefined class constant doesn't show up via AJAX
Submitted: 2011-08-12 09:51 UTC Modified: 2011-08-12 11:57 UTC
From: r1pp3r dot j4ck at gmail dot com Assigned:
Status: Not a bug Package: Class/Object related
PHP Version: 5.3.6 OS: Linux
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: r1pp3r dot j4ck at gmail dot com
New email:
PHP Version: OS:

 

 [2011-08-12 09:51 UTC] r1pp3r dot j4ck at gmail dot com
Description:
------------
Fatal error: undefined class constant doesn't show up via AJAX, neither in the 
error log, so it crashes without any warning making the debugging really 
complicated. Actually the file doesn't load at all, tried with string out of the 
<?php ?> tags.

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

class random
{
   const test = 1;

   echo $this::tes;
}

?>

Expected result:
----------------
asdfasdf
Undefined class constant 'tes' in ...


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-08-12 11:57 UTC] pierrick@php.net
-Status: Open +Status: Bogus
 [2011-08-12 11:57 UTC] pierrick@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

You have a syntax error, you can not do an echo directly into the class body.
 [2011-08-12 12:06 UTC] r1pp3r dot j4ck at gmail dot com
I'm sorry, I was a bit tired, so... the problem occurred to me when I was in a 
public function, and it never created a log entry. It gave me a fatal error 
without using the function with the undefined constant, the test script was bad, 
sorry.
 [2011-08-12 12:07 UTC] r1pp3r dot j4ck at gmail dot com
I mean it gave me a fatal error without actually informing me about it.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Oct 31 23:01:28 2024 UTC