Doc #65308 [Com]: register_shutdown_function can take a closure, not just a callback name

From: Date: Mon, 22 Jul 2013 18:12:38 +0000
Subject: Doc #65308 [Com]: register_shutdown_function can take a closure, not just a callback name
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-10104@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=65308&edit=1 ID: 65308 Comment by: mail+php at requinix dot net Reported by: fgmarand at gmail dot com Summary: register_shutdown_function can take a closure, not just a callback name Status: Open Type: Documentation Problem Package: Documentation problem Operating System: Linux PHP Version: 5.4.17 Block user comment: N Private report: N New Comment: I don't see anything that says it only supports strings while it does mention callable and callback... Closures certainly qualify for both. Previous Comments: ------------------------------------------------------------------------ [2013-07-22 08:07:27] fgmarand at gmail dot com Description: ------------ --- From manual page: http://www.php.net/function.register-shutdown- function#refsect1-function.register-shutdown-function-description --- register_shutdown_function(function () { echo "Hello world\n"; }); This actually works, although the manual has no mention of Closure support. Expected result: ---------------- According to the doc, this should cause an invalid argument error, Actual result: -------------- It works, so it should be documented, since PHP is moving from "function name/array" callbacks to Closures for a number of versions. ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=65308&edit=1

« previous php.doc.bugs (#10104) next »