Sanhedrin, Chapter Seven, Mishnah Eleven
Mishnah eleven deals with different forms of sorcery.
1) A sorcerer, if he actually performs magic, is liable [to death], but not if he merely creates illusions.
a) Rabbi Akiva says in Rabbi Joshua’s name: If two are gathering cucumbers [by magic] one may be punished and the other exempt: he who really gathers them is punished: while he who produces an illusion is exempt.
When the mishnah stated that a sorcerer is liable to be stoned, it meant one who actually performs magic, but not one who creates illusions. [Therefore, modern magicians who use illusions are not obligated for the death penalty]. Rabbi Akiva in the name of Rabbi Joshua illustrates this principle by mentioning a form of magic that must have been at least somewhat known in the time of the mishnah, something like pulling a rabbit out of a hat in our days.