3v4l.org

run code in 500+ PHP versions simultaneously
<?php $client = (object) ['id' => 1]; // system(id) is removed $databaseValue = '$client->id; system("id")'; preg_match_all('/(?:\s|^)\$(?:[^\s]+?)(?:[a-z])+(?:->|$)?(?:[a-z]|[A-Z])+/', $databaseValue, $matches); if (!empty($matches)) { $firstVariableOccurance = current(current($matches)); eval("\$value = {$firstVariableOccurance};"); echo "Send command {$value}"; }

preferences:
92.99 ms | 1242 KiB | 5 Q