Convert variable to type_string

type:to_string($variable) : STRING

type:to_string(3.30)
#=> "3.30"

type:to_string('hi')
#=> "hi" (no change)

type:to_string([1,2])
#=> Error: type_array to type_string conversion

type:to_string(function(){})
#=> Error: type_function could not be converted to type_string

# let's detect the type of variable after converting to type_string
$x = 3;
$x = type:to_string($x)
print type:detect($x)
#=> type_string

Copyright ©2013-2022 SunSed®. All rights reserved.