summaryrefslogtreecommitdiff
path: root/Zend/tests/closure_005.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'Zend/tests/closure_005.phpt')
-rw-r--r--Zend/tests/closure_005.phpt62
1 files changed, 31 insertions, 31 deletions
diff --git a/Zend/tests/closure_005.phpt b/Zend/tests/closure_005.phpt
index b3be877216..52b8d49059 100644
--- a/Zend/tests/closure_005.phpt
+++ b/Zend/tests/closure_005.phpt
@@ -4,37 +4,37 @@ Closure 005: Lambda inside class, lifetime of $this
<?php
class A {
- private $x;
-
- function __construct($x) {
- $this->x = $x;
- }
-
- function __destruct() {
- echo "Destroyed\n";
- }
-
- function getIncer($val) {
- return function() use ($val) {
- $this->x += $val;
- };
- }
-
- function getPrinter() {
- return function() {
- echo $this->x."\n";
- };
- }
-
- function getError() {
- return static function() {
- echo $this->x."\n";
- };
- }
-
- function printX() {
- echo $this->x."\n";
- }
+ private $x;
+
+ function __construct($x) {
+ $this->x = $x;
+ }
+
+ function __destruct() {
+ echo "Destroyed\n";
+ }
+
+ function getIncer($val) {
+ return function() use ($val) {
+ $this->x += $val;
+ };
+ }
+
+ function getPrinter() {
+ return function() {
+ echo $this->x."\n";
+ };
+ }
+
+ function getError() {
+ return static function() {
+ echo $this->x."\n";
+ };
+ }
+
+ function printX() {
+ echo $this->x."\n";
+ }
}
$a = new A(3);