Annotation of embedaddon/php/ext/standard/tests/general_functions/bug32647.phpt, revision 1.1

1.1     ! misho       1: --TEST--
        !             2: Bug #32647 (Using register_shutdown_function() with invalid callback can crash PHP)
        !             3: --INI--
        !             4: error_reporting=4095
        !             5: display_errors=1
        !             6: --FILE--
        !             7: <?php
        !             8: 
        !             9: function foo()
        !            10: {
        !            11:   echo "foo!\n";
        !            12: }
        !            13: 
        !            14: class bar
        !            15: {
        !            16:        function barfoo ()
        !            17:        { echo "bar!\n"; }
        !            18: }
        !            19: 
        !            20: unset($obj);
        !            21: register_shutdown_function(array($obj,""));            // Invalid
        !            22: register_shutdown_function(array($obj,"some string")); // Invalid
        !            23: register_shutdown_function(array(0,""));               // Invalid
        !            24: register_shutdown_function(array('bar','foo'));        // Invalid
        !            25: register_shutdown_function(array(0,"some string"));    // Invalid
        !            26: register_shutdown_function('bar');                     // Invalid
        !            27: register_shutdown_function('foo');                     // Valid
        !            28: register_shutdown_function(array('bar','barfoo'));     // Invalid
        !            29: 
        !            30: $obj = new bar;
        !            31: register_shutdown_function(array($obj,'foobar'));      // Invalid
        !            32: register_shutdown_function(array($obj,'barfoo'));      // Valid
        !            33: 
        !            34: ?>
        !            35: --EXPECTF--
        !            36: Notice: Undefined variable: obj in %s on line %d
        !            37: 
        !            38: Warning: register_shutdown_function(): Invalid shutdown callback 'Array' passed in %s on line %d
        !            39: 
        !            40: Notice: Undefined variable: obj in %s on line %d
        !            41: 
        !            42: Warning: register_shutdown_function(): Invalid shutdown callback 'Array' passed in %s on line %d
        !            43: 
        !            44: Warning: register_shutdown_function(): Invalid shutdown callback 'Array' passed in %s on line %d
        !            45: 
        !            46: Warning: register_shutdown_function(): Invalid shutdown callback 'bar::foo' passed in %s on line %d
        !            47: 
        !            48: Warning: register_shutdown_function(): Invalid shutdown callback 'Array' passed in %s on line %d
        !            49: 
        !            50: Warning: register_shutdown_function(): Invalid shutdown callback 'bar' passed in %s on line %d
        !            51: 
        !            52: Strict Standards: Non-static method bar::barfoo() should not be called statically in %sbug32647.php on line %d
        !            53: 
        !            54: Warning: register_shutdown_function(): Invalid shutdown callback 'bar::foobar' passed in %sbug32647.php on line %d
        !            55: foo!
        !            56: 
        !            57: Strict Standards: Non-static method bar::barfoo() should not be called statically in Unknown on line 0
        !            58: 
        !            59: Strict Standards: Non-static method bar::barfoo() should not be called statically in Unknown on line 0
        !            60: bar!
        !            61: bar!

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>