1
0
mirror of https://github.com/php/php-src.git synced 2026-04-23 07:58:20 +02:00
Files
archived-php-src/Zend/tests/constants_002.phpt
T
Felipe Pena e35c457913 - New tests
2008-05-12 17:57:21 +00:00

25 lines
574 B
PHP

--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)