Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Finds whether a variable is a resource
<?php is_resource(mixed $value): bool
<?php }
foreach ($this->lobs as [$source, $target]) {
if (is_resource($source)) {
$this->copyStreamToStream($source, $target);
continue;
<?php }
if ($types[$parameter - 1] === static::$_paramTypeMap[ParameterType::LARGE_OBJECT]) {
if (is_resource($value)) {
if (get_resource_type($value) !== 'stream') {
throw NonStreamResourceUsedAsLargeObject::new($parameter);
}
<?php $parser->parse($query, $visitor);
$stmt = oci_parse($dbh, $visitor->getSQL());
assert(is_resource($stmt));
$this->_sth = $stmt;
$this->_dbh = $dbh;
<?php return null;
}
$value = is_resource($value) ? stream_get_contents($value) : $value;
set_error_handler(function (int $code, string $message): bool {
throw ConversionException::conversionFailedUnserialization($this->getName(), $message);
<?php if (is_string($value)) {
$fp = fopen('php://temp', 'rb+');
assert(is_resource($fp));
fwrite($fp, $value);
fseek($fp, 0);
$value = $fp;
<?php $value = $fp;
}
if (! is_resource($value)) {
throw ConversionException::conversionFailed($value, Types::BINARY);
}
<?php if (is_string($value)) {
$fp = fopen('php://temp', 'rb+');
assert(is_resource($fp));
fwrite($fp, $value);
fseek($fp, 0);
$value = $fp;
<?php $value = $fp;
}
if (! is_resource($value)) {
throw ConversionException::conversionFailed($value, Types::BLOB);
}
<?php return null;
}
if (is_resource($value)) {
$value = stream_get_contents($value);
}
<?php return null;
}
$value = is_resource($value) ? stream_get_contents($value) : $value;
set_error_handler(function (int $code, string $message): bool {
throw ConversionException::conversionFailedUnserialization($this->getName(), $message);
<?php return [];
}
$value = is_resource($value) ? stream_get_contents($value) : $value;
return explode(',', $value);
}
<?php public function convertToPHPValue($value, AbstractPlatform $platform)
{
return is_resource($value) ? stream_get_contents($value) : $value;
}
<?php if (is_resource($value)) {
$value = stream_get_contents($value);
}