2008-05-12 17:57:21 +00:00
|
|
|
--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--
|
2014-12-21 03:03:49 +00:00
|
|
|
Warning: Constants may only evaluate to scalar values or arrays in %s on line %d
|
2008-05-12 17:57:21 +00:00
|
|
|
|
2017-03-04 22:47:19 +00:00
|
|
|
Warning: Use of undefined constant foo - assumed 'foo' (this will throw an Error in a future version of PHP) in %s on line %d
|
2008-05-12 17:57:21 +00:00
|
|
|
string(%d) "foo"
|
|
|
|
resource(%d) of type (stream)
|