标签: php
我需要做类似的事情:
$object = (typeof($object))$value;
知道$object和$value都是标量类型。
$object
$value
答案 0 :(得分:0)
$copy = $value; if(settype($copy, gettype($object))) $object = $copy;