summaryrefslogtreecommitdiff
path: root/Zend/tests/bug48693.phpt
blob: f916b6407bf60b9b01d2722c6f323b2d96e8d0c9 (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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
--TEST--
Bug #48693 (Double declaration of __lambda_func when lambda wrongly formatted)
--FILE--
<?php

try {
	$x = create_function('', 'return 1; }');
} catch (ParseError $e) {
	echo "$e\n\n";
}
try {
	$y = create_function('', 'function a() { }; return 2;');
} catch (ParseError $e) {
	echo "$e\n\n";
}
try {
	$z = create_function('', '{');
} catch (ParseError $e) {
	echo "$e\n\n";
}
try {
	$w = create_function('', 'return 3;');
} catch (ParseError $e) {
	echo "$e\n\n";
}

var_dump(
	$y(),
	$w()
);

?>
--EXPECTF--
Deprecated: Function create_function() is deprecated in %s on line %d
ParseError: syntax error, unexpected '}', expecting end of file in %sbug48693.php(4) : runtime-created function:1
Stack trace:
#0 %sbug48693.php(4): create_function('', 'return 1; }')
#1 {main}


Deprecated: Function create_function() is deprecated in %s on line %d

Deprecated: Function create_function() is deprecated in %s on line %d
ParseError: syntax error, unexpected end of file in %sbug48693.php(14) : runtime-created function:1
Stack trace:
#0 %sbug48693.php(14): create_function('', '{')
#1 {main}


Deprecated: Function create_function() is deprecated in %s on line %d
int(2)
int(3)