|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2005-09-10 09:05 UTC] st_hermansson at spray dot se
Description:
------------
BCompiler version: 0.7
PHP version: 5.1.0RC1
ZEND version: 2.1.0-dev
Configure line:
cscript /nologo configure.js --enable-sockets --without-dom --without-libxml --with-bz2 --enable-bz2-filter --enable-soap --enable-bcompiler
Class names starting with a capital letter in a PHP bytecode file seems to create a ghost-class when loading it.
It exists in get_defined_classes() but not in the actual PHP script.
Also, creating new classes inside classes starting with capital letters crashes PHP.
There seems to be another problem relating to a crash when the PHP script has ended. Im still looking into though.
I usually run Linux but i figured that i need to test the Windows NT platform aswell.
Reproduce code:
---------------
---- The PHP file to be compiled ----
<?php
class ABC_abc {
function createNew() {
$a = &new ABC_abc;
return $a;
}
}
class DEF_def extends ABC_abc {
public $empty = NULL;
}
?>
Expected result:
----------------
Creating a new instance of DEF_def class will fail,
"could not extend class 'ABC_abc'".
Visible in var_dump(get_defined_classes()) though.
Creating a new instance of ABC_abc, when it works, and calling the createNew() method results in a crash.
Also, another thing is that PHP crashes when the scripts ends. This might not be this actual code but im looking into that problem.
Actual result:
--------------
None.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 19:00:01 2025 UTC |
With the PHP 5.1.1 it seems that the bcompiler is not working any more with classes (at least on Win32 plateforms) : encoding the following code will generate an apache crash (i use php as module) : <? class test {}; ?> Has something changed with the class handling ? I used all the win32 binaries provided.Due to changes in Zend Engine bcompiler crashed for PHP 5.1 (and, I'm sure, 6.0). Now it should be fixed on CVS. The script I used to test this bug: <?php class ABC_abc { function createNew() { $a = &new ABC_abc; return $a; } } class DEF_def extends ABC_abc { public $empty = NULL; } echo "#1\n"; $a = new ABC_abc(); var_dump($a); echo "#2\n"; $b = $a->createNew(); var_dump($b); echo "#3\n"; $c = new DEF_def(); var_dump($c); echo "#4\n"; $d = $c->createNew(); var_dump($d); ?>Here is a backtrace for this bug with php-5.1.2 on Linux. Is there any chance of a new release for this? _efree (ptr=0x0) at /usr/src/php-5.1.2/Zend/zend_alloc.c:286 286 CALCULATE_REAL_SIZE_AND_CACHE_INDEX(p->size); (gdb) bt #0 _efree (ptr=0x0) at /usr/src/php-5.1.2/Zend/zend_alloc.c:286 #1 0xb774fff2 in destroy_zend_class (pce=0x0) at /usr/src/php-5.1.2/Zend/zend_opcode.c:170 #2 0xb775d20c in zend_hash_apply_deleter (ht=0x80f2650, p=0x823c468) at /usr/src/php-5.1.2/Zend/zend_hash.c:574 #3 0xb775d30a in zend_hash_apply (ht=0x80f2650, apply_func=0xb774c918 <is_not_internal_class>) at /usr/src/php-5.1.2/Zend/zend_hash.c:665 #4 0xb774cf26 in shutdown_executor () at /usr/src/php-5.1.2/Zend/zend_execute_API.c:262 #5 0xb7756483 in zend_deactivate () at /usr/src/php-5.1.2/Zend/zend.c:846 #6 0xb772564a in php_request_shutdown (dummy=0x0) at /usr/src/php-5.1.2/main/main.c:1284 #7 0xb77ad6d6 in apache_php_module_main (r=0x81aa0e4, display_source_mode=0) at /usr/src/php-5.1.2/sapi/apache/sapi_apache.c:59 #8 0xb77adf82 in send_php (r=0x81aa0e4, display_source_mode=0, filename=0x0) at /usr/src/php-5.1.2/sapi/apache/mod_php5.c:643 #9 0xb77ae0ea in send_parsed_php (r=0x81aa0e4) at /usr/src/php-5.1.2/sapi/apache/mod_php5.c:658 #10 0x080748a7 in ap_invoke_handler () #11 0x08089b2b in process_request_internal () #12 0x08089f74 in ap_internal_redirect () #13 0x08067d48 in mod_gzip_redir1_handler () #14 0x080662f6 in mod_gzip_handler () #15 0x080748a7 in ap_invoke_handler () #16 0x08089b2b in process_request_internal () #17 0x08089b8a in ap_process_request () #18 0x080809d9 in child_main () #19 0x08080b79 in make_child () #20 0x08080cdf in startup_children () #21 0x08081396 in standalone_main () #22 0x08081bb4 in main ()