HEX
Server: Apache
System: Linux server2.voipitup.com.au 4.18.0-553.109.1.lve.el8.x86_64 #1 SMP Thu Mar 5 20:23:46 UTC 2026 x86_64
User: posscale (1027)
PHP: 8.2.30
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //proc/self/root/opt/alt/php74/usr/share/pear/test/jsond/tests/unsupported_type_error.phpt
--TEST--
An error is thrown when an unsupported type is encoded
--SKIPIF--
<?php if (!extension_loaded("jsond")) print "skip"; ?>
--FILE--
<?php
require_once "bootstrap.inc";

$resource = fopen(__FILE__, "r");

var_dump($resource);

var_dump($jsond_encode($resource));
var_dump($jsond_last_error(), $jsond_last_error_msg());

var_dump($jsond_encode($resource, jsond_constant('PARTIAL_OUTPUT_ON_ERROR')));
var_dump($jsond_last_error(), $jsond_last_error_msg());

?>
--EXPECTF--
resource(%d) of type (stream)
bool(false)
int(8)
string(21) "Type is not supported"
string(4) "null"
int(8)
string(21) "Type is not supported"