mirror of
https://github.com/php/php-src.git
synced 2026-04-18 05:21:02 +02:00
Casting objects to bool is supposed to yield `true`. Since the `cast_object` handler is required now, we have to implement the `_IS_BOOL` conversion there.
18 lines
346 B
PHP
18 lines
346 B
PHP
--TEST--
|
|
Bug #79749 (Converting FFI instances to bool fails)
|
|
--SKIPIF--
|
|
<?php
|
|
if (!extension_loaded('ffi')) die('skip ffi extension not available');
|
|
?>
|
|
--FILE--
|
|
<?php
|
|
$ffi = FFI::cdef('typedef int dummy;');
|
|
var_dump((bool) $ffi);
|
|
var_dump((bool) FFI::type('int'));
|
|
var_dump((bool) FFI::new('int'));
|
|
?>
|
|
--EXPECT--
|
|
bool(true)
|
|
bool(true)
|
|
bool(true)
|