3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $transactionId = "Sok234141341"; $gaClientId = "41233412.31231"; $redisData = $transactionId; $redisData = json_encode([ 'transactionId' => $transactionId, 'gaClientId' => $gaClientId ]); $data = json_decode($redisData); $tid = $data['transactionId']; $gid = $data['gaClientId']; var_dump("$tid $gid"); if (json_last_error() !== JSON_ERROR_NONE) { $tid = $data; $gid = null; } var_dump("$tid $gid");
based on KIdD3