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] = array_key_exists($key, $map) ? $map[$value] : $value; } print_r($input);

preferences:
49.54 ms | 402 KiB | 5 Q