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
Output for 8.0.1 - 8.0.30, 8.1.0 - 8.1.34, 8.2.0 - 8.2.30, 8.3.0 - 8.3.30, 8.4.1 - 8.4.18, 8.5.0 - 8.5.3
Fatal error: Uncaught Error: Class "DB" not found in /in/IFcrC:3 Stack trace: #0 {main} thrown in /in/IFcrC on line 3
Process exited with code 255.
Output for 7.4.0 - 7.4.33
Fatal error: Uncaught Error: Class 'DB' not found in /in/IFcrC:3 Stack trace: #0 {main} thrown in /in/IFcrC on line 3
Process exited with code 255.

preferences:
269.39 ms | 1268 KiB | 4 Q