|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2016-04-20 20:34 UTC] requinix@php.net
-Status: Open
+Status: Not a bug
[2016-04-20 20:34 UTC] requinix@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 01 19:00:02 2025 UTC |
Description: ------------ class MyStorage extends SplStack{} $closure = function($elem){ $this->push($elem); return $this; }; $stack = $closure->call(new MyStorage(), 1); $stack = $closure->call($stack, 2); echo $stack->pop(); // return 2 ------------------------------------ ------------------------------------ class MyStorage extends SplQueue{} $closure = function($elem){ $this->push($elem); return $this; }; $stack = $closure->call(new MyStorage(), 1); $stack = $closure->call($stack, 2); echo $stack->pop(); // return 2