]> granicus.if.org Git - php/commitdiff
Revert "Merge branch 'pull-request/2082' (get_class accidentally in PHP-7.1)"
authorBob Weinand <bobwei9@hotmail.com>
Thu, 13 Oct 2016 08:40:00 +0000 (10:40 +0200)
committerBob Weinand <bobwei9@hotmail.com>
Thu, 13 Oct 2016 08:40:42 +0000 (10:40 +0200)
This reverts commit b0cacee3031b9f8ae983db3a690707b0ed68f7f8, reversing
changes made to fcbfd9835de536ea5a487492da56dac548a096e1.

Zend/tests/009.phpt
Zend/zend_builtin_functions.c
ext/standard/tests/class_object/get_class_variation_001.phpt

index 0dc945357665c7c2498835fc14011ad55e3c3c40..b44a6ba68732957ec29ff27c13e45213d596450b 100644 (file)
@@ -7,10 +7,6 @@ class foo {
        function bar () {
                var_dump(get_class());
        }
-    function testNull ()
-    {
-        var_dump(get_class(null));
-    }
 }
 
 class foo2 extends foo {
@@ -31,8 +27,6 @@ var_dump(get_class("qwerty"));
 var_dump(get_class($f1));
 var_dump(get_class($f2));
 
-$f1->testNull();
-
 echo "Done\n";
 ?>
 --EXPECTF--    
@@ -51,7 +45,4 @@ Warning: get_class() expects parameter 1 to be object, string given in %s on lin
 bool(false)
 string(3) "foo"
 string(4) "foo2"
-
-Warning: get_class() expects parameter 1 to be object, null given in %s on line %d
-bool(false)
 Done
index d99ebb292e07af1beae729a7294ecfc465a89912..0fb0036b7f467cfc9c7e3b46c537252f94ef33b7 100644 (file)
@@ -1001,7 +1001,7 @@ ZEND_FUNCTION(get_class)
 {
        zval *obj = NULL;
 
-       if (zend_parse_parameters(ZEND_NUM_ARGS(), "|o", &obj) == FAILURE) {
+       if (zend_parse_parameters(ZEND_NUM_ARGS(), "|o!", &obj) == FAILURE) {
                RETURN_FALSE;
        }
 
index 3987968e90452d15e953ae11ddccb1df424c9e1d..d39da3a99132ada065a023606a30ff47929069b5 100644 (file)
@@ -152,12 +152,12 @@ bool(false)
 
 Arg value:  (type: NULL)
 
-Warning: get_class() expects parameter 1 to be object, null given in %s on line %d
+Warning: get_class() called without object from outside a class in %sget_class_variation_001.php on line %d
 bool(false)
 
 Arg value:  (type: NULL)
 
-Warning: get_class() expects parameter 1 to be object, null given in %s on line %d
+Warning: get_class() called without object from outside a class in %sget_class_variation_001.php on line %d
 bool(false)
 
 Arg value: 1 (type: boolean)
@@ -202,11 +202,11 @@ bool(false)
 
 Arg value:  (type: NULL)
 
-Warning: get_class() expects parameter 1 to be object, null given in %s on line %d
+Warning: get_class() called without object from outside a class in %sget_class_variation_001.php on line %d
 bool(false)
 
 Arg value:  (type: NULL)
 
-Warning: get_class() expects parameter 1 to be object, null given in %s on line %d
+Warning: get_class() called without object from outside a class in %sget_class_variation_001.php on line %d
 bool(false)
 Done