diff --git a/NEWS b/NEWS index e22b0994ff761..60bab0e669216 100644 --- a/NEWS +++ b/NEWS @@ -8,6 +8,7 @@ PHP NEWS - Added LIBXML_LOADED_VERSION constant (libxml2 version currently used). (Rob) +- Fixed bug #47664 (get_class returns NULL instead of FALSE). (Dmitry) - Fixed bug #47593 (interface_exists() returns false when using absolute namespace path). (Kalle, Felipe) - Fixed bug #47572 (Undefined constant causes segmentation fault). (Felipe) diff --git a/Zend/tests/009.phpt b/Zend/tests/009.phpt index 3efda91b684bf..f122b714dac2f 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, string given in %s on line %d -NULL +bool(false) string(3) "foo" string(4) "foo2" Done diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c index 3dbd080510307..6f1774de273a8 100644 --- a/Zend/zend_builtin_functions.c +++ b/Zend/zend_builtin_functions.c @@ -719,7 +719,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/standard/tests/class_object/get_class_error_001.phpt b/ext/standard/tests/class_object/get_class_error_001.phpt index fb3bacb904ef8..555099502dd81 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 14 -NULL +bool(false) Done \ No newline at end of file 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 2e83b1dc5eea7..79caa1f30d171 100644 --- a/ext/standard/tests/class_object/get_class_variation_001.phpt +++ b/ext/standard/tests/class_object/get_class_variation_001.phpt @@ -76,137 +76,137 @@ echo "Done"; --EXPECTF-- *** Testing get_class() : usage variations *** -Notice: Undefined variable: undefined_var in %s on line 58 +Notice: Undefined variable: undefined_var in /home/dmitry/php/php5.3/ext/standard/tests/class_object/get_class_variation_001.php on line 58 -Notice: Undefined variable: unset_var in %s on line 61 +Notice: Undefined variable: unset_var in /home/dmitry/php/php5.3/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/php5.3/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/php5.3/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/php5.3/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/php5.3/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/php5.3/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/php5.3/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/php5.3/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/php5.3/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/php5.3/ext/standard/tests/class_object/get_class_variation_001.php on line 68 +bool(false) 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/php5.3/ext/standard/tests/class_object/get_class_variation_001.php on line 68 +bool(false) 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/php5.3/ext/standard/tests/class_object/get_class_variation_001.php on line 68 +bool(false) 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/php5.3/ext/standard/tests/class_object/get_class_variation_001.php on line 68 +bool(false) 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/php5.3/ext/standard/tests/class_object/get_class_variation_001.php on line 68 +bool(false) 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/php5.3/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/php5.3/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/php5.3/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/php5.3/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/php5.3/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/php5.3/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/php5.3/ext/standard/tests/class_object/get_class_variation_001.php on line 68 +bool(false) Arg value: (type: string) -Warning: get_class() expects parameter 1 to be object, string given in %s on line %d -NULL +Warning: get_class() expects parameter 1 to be object, string given in /home/dmitry/php/php5.3/ext/standard/tests/class_object/get_class_variation_001.php on line 68 +bool(false) Arg value: (type: string) -Warning: get_class() expects parameter 1 to be object, string given in %s on line %d -NULL +Warning: get_class() expects parameter 1 to be object, string given in /home/dmitry/php/php5.3/ext/standard/tests/class_object/get_class_variation_001.php on line 68 +bool(false) Arg value: string (type: string) -Warning: get_class() expects parameter 1 to be object, string given in %s on line %d -NULL +Warning: get_class() expects parameter 1 to be object, string given in /home/dmitry/php/php5.3/ext/standard/tests/class_object/get_class_variation_001.php on line 68 +bool(false) Arg value: string (type: string) -Warning: get_class() expects parameter 1 to be object, string given in %s on line %d -NULL +Warning: get_class() expects parameter 1 to be object, string given in /home/dmitry/php/php5.3/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/php5.3/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 -Done \ No newline at end of file +Warning: get_class() expects parameter 1 to be object, null given in /home/dmitry/php/php5.3/ext/standard/tests/class_object/get_class_variation_001.php on line 68 +bool(false) +Done