blob: 2e769f5dbf879a6b8a50f76021e56d83dce6c545 (
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
|
--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 in %s on line %d
Notice: Use of undefined constant foo - assumed 'foo' in %s on line %d
string(%d) "foo"
resource(%d) of type (stream)
--UEXPECTF--
Warning: Constants may only evaluate to scalar values in %s on line %d
Notice: Use of undefined constant foo - assumed 'foo' in %s on line %d
unicode(%d) "foo"
resource(%d) of type (stream)
|