|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2014-04-21 20:21 UTC] bwoebi@php.net
-Status: Open
+Status: Closed
-Assigned To:
+Assigned To: bwoebi
[2014-04-21 20:21 UTC] bwoebi@php.net
[2014-04-21 20:22 UTC] bwoebi@php.net
-Status: Closed
+Status: Not a bug
-Assigned To: bwoebi
+Assigned To: -
[2014-04-22 02:08 UTC] hewei986532 at sina dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 15 04:00:01 2025 UTC |
Description: ------------ throw an error ‘ Fatal error: Uncaught exception 'Exception' with message 'Serialization of 'Closure' is not allowed' in /mnt/hgfs/www/test2.php:5 Stack trace: #0 /mnt/hgfs/www/test2.php(5): test::map() #1 /mnt/hgfs/www/test2.php(12): test->map(Array) #2 {main} thrown in /mnt/hgfs/www/test2.php on line 5’ when the class extends class Test script: --------------- class test extends Worker { public function map($t) { $this->a = $t;var_dump($this->a);exit; } } $map = new test; $function = function($i){ return $i; }; $c = 1000000;$map->map(array($function, array($c))); Expected result: ---------------- array(2) { [0]=> object(Closure)#2 (1) { ["parameter"]=> array(1) { ["$i"]=> string(10) "" } } [1]=> array(1) { [0]=> int(1000000) } } Actual result: -------------- Fatal error: Uncaught exception 'Exception' with message 'Serialization of 'Closure' is not allowed' in /mnt/hgfs/www/lib/MapReduce.php:15 Stack trace: #0 /mnt/hgfs/www/lib/MapReduce.php(15): MapReduce::map() #1 /mnt/hgfs/www/lib/MapReduce.php(39): MapReduce->map(Array) #2 {main} thrown in /mnt/hgfs/www/lib/MapReduce.php on line 15