php-src/Zend/tests/constants_002.phpt
Nikita Popov 53aed48e5d Allow objects in define()
This was separately discussed in https://externals.io/message/114863,
but also necessary for consistency now that
https://wiki.php.net/rfc/new_in_initializers has landed.

Closes GH-7149.
2021-07-15 10:09:56 +02:00

17 lines
237 B
PHP

--TEST--
Defining constants with non-scalar values
--FILE--
<?php
define('foo', new stdClass);
var_dump(foo);
define('bar', fopen(__FILE__, 'r'));
var_dump(bar);
?>
--EXPECTF--
object(stdClass)#1 (0) {
}
resource(%d) of type (stream)