xref: /PHP-7.4/Zend/tests/constants_002.phpt (revision 0a6ddc77)
1--TEST--
2Defining constants with non-scalar values
3--FILE--
4<?php
5
6define('foo', new stdClass);
7var_dump(foo);
8
9define('foo', fopen(__FILE__, 'r'));
10var_dump(foo);
11
12?>
13--EXPECTF--
14Warning: Constants may only evaluate to scalar values, arrays or resources in %s on line %d
15
16Warning: Use of undefined constant foo - assumed 'foo' (this will throw an Error in a future version of PHP) in %s on line %d
17string(%d) "foo"
18resource(%d) of type (stream)
19