3v4l.org

run code in 300+ PHP versions simultaneously
<?php $currencies = [ 'mxn' => [ 'sign' => '$', 'plans' => [ 'tiny' => 429, 'small' => 1319, 'medium' => 3399, 'big' => 6669 ] ], 'usd' => [ 'sign' => '$', 'plans' => [ 'tiny' => 29, 'small' => 319, 'medium' => 399, 'big' => 669 ] ] ]; $currency='mxn'; if(!isset($currencies[$currency])){ echo "$currency was not found in the currencies array."; }else{ echo "In $currency:\n"; foreach($currencies[$currency]['plans'] as $size=>$price){ echo "\t$size costs {$currencies[$currency]['sign']}$price\n"; } }

This is an error 500

Value for `_results` contains invalid data `array`


preferences:
160.35 ms | 2019 KiB | 10 Q