|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2000-07-04 21:16 UTC] andi at cvs dot php dot net
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 11 10:00:01 2026 UTC |
Sample script, saved as class.php <?php class MyClass { function myFunc( $arg ){ echo $arg; } } $obj = new MyClass; $obj -> myFunc( "Hello, world" ); ?> Running 'php class.php' works, 'php -e class.php' fails with 'Call to undefined function: ()' The problem is the additional ZEND_EXT_FCALL_BEGIN op which gets in the way in do_begin_dynamic_function_call. I'd humbly suggest modifying do_extended_fcall_begin to something like void do_extended_fcall_begin(CLS_D) { zend_op *opline; int last_op_number = get_next_op_number(CG(active_op_array))-1; if (!CG(extended_info)) { return; } opline = get_next_op(CG(active_op_array) CLS_CC); // If the last instruction is ZEND_FETCH_OBJ_R then it's about to be converted to a // ZEND_INIT_FCALL_BY_NAME in do_begin_dynamic_function_call. So we need to slide the FETCH_OBJ_R // up one and insert the EXT_FCALL_BEGIN before it. if (last_op_number>=0 && CG(active_op_array)->opcodes[last_op_number].opcode == ZEND_FETCH_OBJ_R) { memcpy( opline, &CG(active_op_array)->opcodes[last_op_number], sizeof( zend_op ) ); opline = &CG(active_op_array)->opcodes[ last_op_number ]; } opline->opcode = ZEND_EXT_FCALL_BEGIN; SET_UNUSED(opline->op1); SET_UNUSED(opline->op2); } Regards Mark