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/thread-self/root/opt/cloudlinux/alt-php74/root/usr/share/pear/test/jsond/tests/bug43941.phpt
--TEST--
Bug #43941 (json_encode() invalid UTF-8)
--SKIPIF--
<?php if (!extension_loaded("jsond")) print "skip"; ?>
--FILE--
<?php
require_once "bootstrap.inc";

var_dump($jsond_encode("abc"));
var_dump($jsond_encode("ab\xE0"));
var_dump($jsond_encode("ab\xE0", jsond_constant('PARTIAL_OUTPUT_ON_ERROR')));
var_dump($jsond_encode(
    array("ab\xE0", "ab\xE0c", "abc"),
    jsond_constant('PARTIAL_OUTPUT_ON_ERROR')));

echo "Done\n";
?>
--EXPECTF--
string(5) ""abc""
bool(false)
string(4) "null"
string(17) "[null,null,"abc"]"
Done