blob: 345c1dd822ffbe26ffa1ef89a98829bcec15bf69 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
--TEST--
Defining constants with non-scalar values
--FILE--
<?php
define('foo', new stdClass);
try {
var_dump(foo);
} catch (Error $e) {
echo $e->getMessage(), "\n";
}
define('foo', fopen(__FILE__, 'r'));
var_dump(foo);
?>
--EXPECTF--
Warning: Constants may only evaluate to scalar values, arrays or resources in %s on line %d
Undefined constant "foo"
resource(5) of type (stream)
|