summaryrefslogtreecommitdiff
path: root/ext/standard/tests/general_functions/closures_002.phpt
blob: e0ef5121c039a75f164d664946da15b46002b56f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
--TEST--
register_tick_function() & closure
--FILE--
<?php

declare (ticks = 1);

$i = 0;
register_tick_function(function () use (&$i) { $i++; });

echo "Test\n";
echo "$i\n";
echo "$i\n";
var_dump ($i != 0);
echo "$i\n";
echo "Done\n";

?>
--EXPECTF--
Test
%d
%d
bool(true)
%d
Done