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

Shows result from various feature-branches currently under review from the php developers. Contact me to have additional branches featured.

Output for Typed properties v2
Fatal error: Uncaught Error: Cannot use object of type stdClass as array in /in/5sj57:14 Stack trace: #0 {main} thrown in /in/5sj57 on line 14
Output for Array change keys
Fatal error: Uncaught Error: Cannot use object of type stdClass as array in /in/5sj57:14 Stack trace: #0 {main} thrown in /in/5sj57 on line 14
Output for Lexical anon
Fatal error: Cannot use object of type stdClass as array in /in/5sj57 on line 14

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page