3v4l.org

run code in 300+ PHP versions simultaneously
<?php $map = array('Yes' => true, 'No' => false); $input = array('va' => 'No', 'firsttime' => 'Yes', 'name' => 'foobar', 'price' => 123000); foreach ($input as $key => $value) { @$input[$key] = $map[$value] ?: $value; } var_dump($input);

preferences:
55.53 ms | 402 KiB | 5 Q