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 Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
23 - 15 = ?
Subscribe to this entry?

 
 [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

Add a Patch

Pull Requests

Add a Pull Request

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: Sat May 18 03:02:51 2024 UTC