3v4l.org

run code in 500+ PHP versions simultaneously
<?php $check = DB::table('user')->where('id', $id)->value('Command'); $databaseValue = '$client->id'; preg_match_all('/^\$([a-z]||[A-Z])\S+/', $databaseValue, $matches); if (!empty($matches)) { $firstVariableOccurance = current(current($matches)); eval("\$value = {$firstVariableOccurance};"); $ex = "{$check}"; dd($ex); } // it return me ^ "status $client->id", i.e. the variable is not executed

preferences:
92.6 ms | 1271 KiB | 5 Q