php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #26065 Crash when nesting classes
Submitted: 2003-10-31 17:30 UTC Modified: 2003-12-27 17:58 UTC
From: kester dot everts at wanadoo dot nl Assigned: helly
Status: Closed Package: Scripting Engine problem
PHP Version: 5.0.0b3 OS: *
Private report: No CVE-ID:
 [2003-10-31 17:30 UTC] kester dot everts at wanadoo dot nl
Description:
------------
When nesting a class within another class function, PHP crashes.
I have PHP running on an Apache2 (2.0.47) server as a module.
Changes in my php.ini, different from php.ini-dist are my SMTP server setting, my error reporting level setting to E_ALL and the floating point number precision to 14. No exentions are enabled.

Reproduce code:
---------------
class foo {
 function bar() {
  //here comes the line of doom:
  class my_class {}
 }
}


Expected result:
----------------
I expected PHP to return a fatal error which says that classes cannot be nested.

Actual result:
--------------
PHP crashed...
I am using Windows, so I have not got a backtrace. I have sent an error report to Microsoft; maybe that helps.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-11-01 05:12 UTC] sniper@php.net
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 16384 (LWP 15661)]
0x0830cc13 in zend_do_abstract_method (function_name=0xbfffc450, modifiers=0xbfffc3f0, body=0xbfffc4c8)
    at /usr/src/web/php/php5/Zend/zend_compile.c:445
445             if (CG(active_class_entry)->ce_flags & ZEND_ACC_INTERFACE) {
(gdb) bt
#0  0x0830cc13 in zend_do_abstract_method (function_name=0xbfffc450, modifiers=0xbfffc3f0, body=0xbfffc4c8)
    at /usr/src/web/php/php5/Zend/zend_compile.c:445
#1  0x082ff20d in zendparse () at zend_language_parser.y:457
#2  0x08302336 in compile_file (file_handle=0xbffffbb0, type=2) at zend_language_scanner.l:367
#3  0x08322f6e in zend_execute_scripts (type=8, retval=0x0, file_count=3) at /usr/src/web/php/php5/Zend/zend.c:1005
#4  0x082e1f46 in php_execute_script (primary_file=0xbffffbb0) at /usr/src/web/php/php5/main/main.c:1622
#5  0x0835c13f in main (argc=2, argv=0xbffffc44) at /usr/src/web/php/php5/sapi/cli/php_cli.c:910
(gdb) 
 [2003-12-27 17:58 UTC] helly@php.net
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Thu Apr 24 02:02:10 2014 UTC