From: Dmitry Stogov Date: Mon, 16 Mar 2009 09:52:26 +0000 (+0000) Subject: Fixed bug #47664 (get_class returns NULL instead of FALSE) X-Git-Tag: php-5.4.0alpha1~191^2~4144 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d3e3c4e666b04a0f99bf399a75cb4bf092e7e6a1;p=php Fixed bug #47664 (get_class returns NULL instead of FALSE) --- diff --git a/Zend/tests/009.phpt b/Zend/tests/009.phpt index 3dd8bac771..3b24c2c955 100644 --- a/Zend/tests/009.phpt +++ b/Zend/tests/009.phpt @@ -42,7 +42,7 @@ Warning: get_class() called without object from outside a class in %s on line %d bool(false) Warning: get_class() expects parameter 1 to be object, Unicode string given in %s on line %d -NULL +bool(false) unicode(3) "foo" unicode(4) "foo2" Done diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c index c4c797dd20..078514725b 100644 --- a/Zend/zend_builtin_functions.c +++ b/Zend/zend_builtin_functions.c @@ -716,7 +716,7 @@ ZEND_FUNCTION(get_class) int dup; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|o", &obj) == FAILURE) { - return; + RETURN_FALSE; } if (!obj) { diff --git a/ext/reflection/tests/027.phpt b/ext/reflection/tests/027.phpt index 7839add64f..faccbb6276 100755 --- a/ext/reflection/tests/027.phpt +++ b/ext/reflection/tests/027.phpt @@ -51,7 +51,7 @@ Closure [ function {closure} ] { } } -NULL +bool(false) unicode(9) "{closure}" bool(true) Closure [ public method func ] { diff --git a/ext/standard/tests/class_object/get_class_error_001.phpt b/ext/standard/tests/class_object/get_class_error_001.phpt index ee994fcb7c..0a175fcf97 100644 --- a/ext/standard/tests/class_object/get_class_error_001.phpt +++ b/ext/standard/tests/class_object/get_class_error_001.phpt @@ -24,5 +24,5 @@ echo "Done"; -- Testing get_class() function with more than expected no. of arguments -- Warning: get_class() expects at most 1 parameter, 2 given in %s on line %d -NULL +bool(false) Done diff --git a/ext/standard/tests/class_object/get_class_variation_001.phpt b/ext/standard/tests/class_object/get_class_variation_001.phpt index 36d7ebb400..0c5cca6544 100644 --- a/ext/standard/tests/class_object/get_class_variation_001.phpt +++ b/ext/standard/tests/class_object/get_class_variation_001.phpt @@ -76,147 +76,147 @@ echo "Done"; --EXPECTF-- *** Testing get_class() : usage variations *** -Notice: Undefined variable: undefined_var in %s on line %d +Notice: Undefined variable: undefined_var in /home/dmitry/php/php6/ext/standard/tests/class_object/get_class_variation_001.php on line 58 -Notice: Undefined variable: unset_var in %s on line %d +Notice: Undefined variable: unset_var in /home/dmitry/php/php6/ext/standard/tests/class_object/get_class_variation_001.php on line 61 Arg value: 0 (type: integer) -Warning: get_class() expects parameter 1 to be object, integer given in %s on line %d -NULL +Warning: get_class() expects parameter 1 to be object, integer given in /home/dmitry/php/php6/ext/standard/tests/class_object/get_class_variation_001.php on line 68 +bool(false) Arg value: 1 (type: integer) -Warning: get_class() expects parameter 1 to be object, integer given in %s on line %d -NULL +Warning: get_class() expects parameter 1 to be object, integer given in /home/dmitry/php/php6/ext/standard/tests/class_object/get_class_variation_001.php on line 68 +bool(false) Arg value: 12345 (type: integer) -Warning: get_class() expects parameter 1 to be object, integer given in %s on line %d -NULL +Warning: get_class() expects parameter 1 to be object, integer given in /home/dmitry/php/php6/ext/standard/tests/class_object/get_class_variation_001.php on line 68 +bool(false) Arg value: -2345 (type: integer) -Warning: get_class() expects parameter 1 to be object, integer given in %s on line %d -NULL +Warning: get_class() expects parameter 1 to be object, integer given in /home/dmitry/php/php6/ext/standard/tests/class_object/get_class_variation_001.php on line 68 +bool(false) Arg value: 10.5 (type: double) -Warning: get_class() expects parameter 1 to be object, double given in %s on line %d -NULL +Warning: get_class() expects parameter 1 to be object, double given in /home/dmitry/php/php6/ext/standard/tests/class_object/get_class_variation_001.php on line 68 +bool(false) Arg value: -10.5 (type: double) -Warning: get_class() expects parameter 1 to be object, double given in %s on line %d -NULL +Warning: get_class() expects parameter 1 to be object, double given in /home/dmitry/php/php6/ext/standard/tests/class_object/get_class_variation_001.php on line 68 +bool(false) Arg value: 101234567000 (type: double) -Warning: get_class() expects parameter 1 to be object, double given in %s on line %d -NULL +Warning: get_class() expects parameter 1 to be object, double given in /home/dmitry/php/php6/ext/standard/tests/class_object/get_class_variation_001.php on line 68 +bool(false) Arg value: 1.07654321E-9 (type: double) -Warning: get_class() expects parameter 1 to be object, double given in %s on line %d -NULL +Warning: get_class() expects parameter 1 to be object, double given in /home/dmitry/php/php6/ext/standard/tests/class_object/get_class_variation_001.php on line 68 +bool(false) Arg value: 0.5 (type: double) -Warning: get_class() expects parameter 1 to be object, double given in %s on line %d -NULL +Warning: get_class() expects parameter 1 to be object, double given in /home/dmitry/php/php6/ext/standard/tests/class_object/get_class_variation_001.php on line 68 +bool(false) -Notice: Array to string conversion in %s on line %d +Notice: Array to string conversion in /home/dmitry/php/php6/ext/standard/tests/class_object/get_class_variation_001.php on line 67 Arg value: Array (type: array) -Warning: get_class() expects parameter 1 to be object, array given in %s on line %d -NULL +Warning: get_class() expects parameter 1 to be object, array given in /home/dmitry/php/php6/ext/standard/tests/class_object/get_class_variation_001.php on line 68 +bool(false) -Notice: Array to string conversion in %s on line %d +Notice: Array to string conversion in /home/dmitry/php/php6/ext/standard/tests/class_object/get_class_variation_001.php on line 67 Arg value: Array (type: array) -Warning: get_class() expects parameter 1 to be object, array given in %s on line %d -NULL +Warning: get_class() expects parameter 1 to be object, array given in /home/dmitry/php/php6/ext/standard/tests/class_object/get_class_variation_001.php on line 68 +bool(false) -Notice: Array to string conversion in %s on line %d +Notice: Array to string conversion in /home/dmitry/php/php6/ext/standard/tests/class_object/get_class_variation_001.php on line 67 Arg value: Array (type: array) -Warning: get_class() expects parameter 1 to be object, array given in %s on line %d -NULL +Warning: get_class() expects parameter 1 to be object, array given in /home/dmitry/php/php6/ext/standard/tests/class_object/get_class_variation_001.php on line 68 +bool(false) -Notice: Array to string conversion in %s on line %d +Notice: Array to string conversion in /home/dmitry/php/php6/ext/standard/tests/class_object/get_class_variation_001.php on line 67 Arg value: Array (type: array) -Warning: get_class() expects parameter 1 to be object, array given in %s on line %d -NULL +Warning: get_class() expects parameter 1 to be object, array given in /home/dmitry/php/php6/ext/standard/tests/class_object/get_class_variation_001.php on line 68 +bool(false) -Notice: Array to string conversion in %s on line %d +Notice: Array to string conversion in /home/dmitry/php/php6/ext/standard/tests/class_object/get_class_variation_001.php on line 67 Arg value: Array (type: array) -Warning: get_class() expects parameter 1 to be object, array given in %s on line %d -NULL +Warning: get_class() expects parameter 1 to be object, array given in /home/dmitry/php/php6/ext/standard/tests/class_object/get_class_variation_001.php on line 68 +bool(false) Arg value: (type: NULL) -Warning: get_class() expects parameter 1 to be object, null given in %s on line %d -NULL +Warning: get_class() expects parameter 1 to be object, null given in /home/dmitry/php/php6/ext/standard/tests/class_object/get_class_variation_001.php on line 68 +bool(false) Arg value: (type: NULL) -Warning: get_class() expects parameter 1 to be object, null given in %s on line %d -NULL +Warning: get_class() expects parameter 1 to be object, null given in /home/dmitry/php/php6/ext/standard/tests/class_object/get_class_variation_001.php on line 68 +bool(false) Arg value: 1 (type: boolean) -Warning: get_class() expects parameter 1 to be object, boolean given in %s on line %d -NULL +Warning: get_class() expects parameter 1 to be object, boolean given in /home/dmitry/php/php6/ext/standard/tests/class_object/get_class_variation_001.php on line 68 +bool(false) Arg value: (type: boolean) -Warning: get_class() expects parameter 1 to be object, boolean given in %s on line %d -NULL +Warning: get_class() expects parameter 1 to be object, boolean given in /home/dmitry/php/php6/ext/standard/tests/class_object/get_class_variation_001.php on line 68 +bool(false) Arg value: 1 (type: boolean) -Warning: get_class() expects parameter 1 to be object, boolean given in %s on line %d -NULL +Warning: get_class() expects parameter 1 to be object, boolean given in /home/dmitry/php/php6/ext/standard/tests/class_object/get_class_variation_001.php on line 68 +bool(false) Arg value: (type: boolean) -Warning: get_class() expects parameter 1 to be object, boolean given in %s on line %d -NULL +Warning: get_class() expects parameter 1 to be object, boolean given in /home/dmitry/php/php6/ext/standard/tests/class_object/get_class_variation_001.php on line 68 +bool(false) Arg value: (type: unicode) -Warning: get_class() expects parameter 1 to be object, Unicode string given in %s on line %d -NULL +Warning: get_class() expects parameter 1 to be object, Unicode string given in /home/dmitry/php/php6/ext/standard/tests/class_object/get_class_variation_001.php on line 68 +bool(false) Arg value: (type: unicode) -Warning: get_class() expects parameter 1 to be object, Unicode string given in %s on line %d -NULL +Warning: get_class() expects parameter 1 to be object, Unicode string given in /home/dmitry/php/php6/ext/standard/tests/class_object/get_class_variation_001.php on line 68 +bool(false) Arg value: string (type: unicode) -Warning: get_class() expects parameter 1 to be object, Unicode string given in %s on line %d -NULL +Warning: get_class() expects parameter 1 to be object, Unicode string given in /home/dmitry/php/php6/ext/standard/tests/class_object/get_class_variation_001.php on line 68 +bool(false) Arg value: string (type: unicode) -Warning: get_class() expects parameter 1 to be object, Unicode string given in %s on line %d -NULL +Warning: get_class() expects parameter 1 to be object, Unicode string given in /home/dmitry/php/php6/ext/standard/tests/class_object/get_class_variation_001.php on line 68 +bool(false) Arg value: (type: NULL) -Warning: get_class() expects parameter 1 to be object, null given in %s on line %d -NULL +Warning: get_class() expects parameter 1 to be object, null given in /home/dmitry/php/php6/ext/standard/tests/class_object/get_class_variation_001.php on line 68 +bool(false) Arg value: (type: NULL) -Warning: get_class() expects parameter 1 to be object, null given in %s on line %d -NULL +Warning: get_class() expects parameter 1 to be object, null given in /home/dmitry/php/php6/ext/standard/tests/class_object/get_class_variation_001.php on line 68 +bool(false) Done