]> granicus.if.org Git - php/commitdiff
__autoload error
authorNikita Popov <nikic@php.net>
Sat, 19 Jul 2014 10:57:31 +0000 (12:57 +0200)
committerNikita Popov <nikic@php.net>
Sat, 19 Jul 2014 10:57:31 +0000 (12:57 +0200)
Zend/zend_compile.c

index a4bd629687e54b8135b3037933d4c74cc8e5ead5..ef0f878694f05f025e150486994665d0124fe092 100644 (file)
@@ -6709,6 +6709,11 @@ void zend_compile_func_decl(znode *result, zend_ast *ast TSRMLS_DC) {
                        }
                }
 
+               if (zend_str_equals(lcname, ZEND_AUTOLOAD_FUNC_NAME) && fn->params->children != 1) {
+                       zend_error_noreturn(E_COMPILE_ERROR, "%s() must take exactly 1 argument",
+                               ZEND_AUTOLOAD_FUNC_NAME);
+               }
+
                if (is_closure) {
                        opline = emit_op_tmp(result, ZEND_DECLARE_LAMBDA_FUNCTION, NULL, NULL TSRMLS_CC);
                } else {
@@ -6775,8 +6780,6 @@ void zend_compile_func_decl(znode *result, zend_ast *ast TSRMLS_DC) {
        pass_two(CG(active_op_array) TSRMLS_CC);
        zend_release_labels(0 TSRMLS_CC);
 
-       // TODO.AST __autoload
-
        /* Pop the switch and foreach separators */
        zend_stack_del_top(&CG(switch_cond_stack));
        zend_stack_del_top(&CG(foreach_copy_stack));