summaryrefslogtreecommitdiff
path: root/Zend/tests/constants_002.phpt
blob: 832da1564df751f5b56cd7049142c8da6dda828a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
--TEST--
Defining constants with non-scalar values
--FILE--
<?php

define('foo', new stdClass);
var_dump(foo);

define('foo', fopen(__FILE__, 'r'));
var_dump(foo);

?>
--EXPECTF--
Warning: Constants may only evaluate to scalar values or arrays in %s on line %d

Warning: Use of undefined constant foo - assumed 'foo' (this will throw an Error in a future version of PHP) in %s on line %d
string(%d) "foo"
resource(%d) of type (stream)