]> granicus.if.org Git - php/commitdiff
- Improved fix for bug #52573
authorFelipe Pena <felipe@php.net>
Wed, 18 Aug 2010 01:59:37 +0000 (01:59 +0000)
committerFelipe Pena <felipe@php.net>
Wed, 18 Aug 2010 01:59:37 +0000 (01:59 +0000)
Zend/zend_compile.c
ext/spl/spl_directory.c
ext/spl/tests/bug52573.phpt

index 942b2843177ed3fb6a12d08ae710123d324ef092..66fdec13f1c72493a72d2a53902a81a35d978935 100644 (file)
@@ -2922,7 +2922,8 @@ static zend_bool zend_do_perform_implementation_check(const zend_function *fe, c
                return 0;
        }
 
-       if (proto->common.pass_rest_by_reference
+       if (fe->common.type != ZEND_USER_FUNCTION
+               && proto->common.pass_rest_by_reference
                && !fe->common.pass_rest_by_reference) {
                return 0;
        }
index fe3262ba429908fdc920a8a272c69bf18a1d2cd1..b6970f2ddb85b8ec985e744205a74cca5a8babb2 100755 (executable)
@@ -2586,7 +2586,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_file_object_fgetss, 0, 0, 0)
        ZEND_ARG_INFO(0, allowable_tags)
 ZEND_END_ARG_INFO()
 
-ZEND_BEGIN_ARG_INFO_EX(arginfo_file_object_fscanf, 0, 0, 1) 
+ZEND_BEGIN_ARG_INFO_EX(arginfo_file_object_fscanf, 1, 0, 1) 
        ZEND_ARG_INFO(0, format)
 ZEND_END_ARG_INFO()
 
index 17f2984dfb051bba66b1a78cacf8805c202e4b8e..54587fae1da4e003751622a19e4b54a4d82f4632 100644 (file)
@@ -1,12 +1,18 @@
 --TEST--
 Bug #52573 (SplFileObject::fscanf Segmentation fault)
 --FILE--
-<?php
+<?php // test
 
 $result = null;
 $f = new SplFileObject(__FILE__, 'r');
-$f->fscanf('<?php // %s', $result);
-
+var_dump($f->fscanf('<?php // %s', $result));
+var_dump($result);
+var_dump($f->fscanf('<?php // %s'));
 ?>
 --EXPECTF--
-Warning: Parameter 3 to fscanf() expected to be a reference, value given in %s on line 5
+int(1)
+string(4) "test"
+array(1) {
+  [0]=>
+  NULL
+}