HEX
Server: Apache
System: Linux sg241.singhost.net 2.6.32-896.16.1.lve1.4.51.el6.x86_64 #1 SMP Wed Jan 17 13:19:23 EST 2018 x86_64
User: honghock (909)
PHP: 8.0.30
Disabled: passthru,system,shell_exec,show_source,exec,popen,proc_open
Upload Files
File: //opt/cloudlinux/alt-php54/root/usr/share/pear/test/Config/test/bug11807.phpt
--TEST--
regression test for bug #11807: serializing null values in php arrays
--FILE--
<?php
require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'setup.php.inc';

$path = dirname(__FILE__) . '/bug11807.txt';
$data = array(
    "string" => "id",
    "null" => null,
    "false" => false,
    "zero" => 0,
    "empty_string" => ''
);
$root = $config->parseConfig(
    $data,
    'phparray',
    array('name' => 'conf')
);
$config->writeConfig(
    $path,
    'phparray',
    array('name' => 'conf')
);

print file_get_contents($path);
?>
--CLEAN--
<?php
unlink(dirname(__FILE__) . '/bug11807.txt');
?>
--EXPECT--
<?php
$conf['string'] = 'id';
$conf['null'] = null;
$conf['false'] = false;
$conf['zero'] = 0;
$conf['empty_string'] = '';
?>