object(stdClass)#1 (1) { ["scalar"]=> int(5) } object(stdClass)#2 (1) { ["scalar"]=> float(5.34) } object(stdClass)#3 (1) { ["scalar"]=> string(5) "hello" } object(stdClass)#4 (1) { ["scalar"]=> bool(true) } object(stdClass)#5 (0) { }
转换为对象时,大多数数据类型会转换为具有一个名为 "scalar" 的属性的对象,其值为对应的值。
NULL 值会转换为空对象。