Skip to content

TypeError: ini_set() #457

@hamtil

Description

@hamtil

Version: 2.8.1

Bug Description

TypeError: ini_set() expects parameter 2 to be string, boolean given in /home/users/kulinarstvi/kulinarskeumeni.cz/web/new/vendor/tracy/tracy/src/Tracy/Dumper/Renderer.php:458

public static function jsonEncode($snapshot): string
{
	$old = @ini_set('serialize_precision', '-1'); // @ may be disabled
	try {
		return json_encode($snapshot, JSON_HEX_APOS | JSON_HEX_AMP | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
	} finally {
		@ini_set('serialize_precision', $old); // @ may be disabled
	}
}

Steps To Reproduce

$old = @ini_set('serialize_precision', '-1'); //return false

Expected Behavior

No TypeError

Possible Solution

@ini_set('serialize_precision', $old.''); or better

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions