<?php function check(float $value){ $value < 0.001 or $value > 1000.0 and throw new \InvalidArgumentException( 'FairnessWeight must be in the range [0.001, 1000].', ); } $values = [0.0, 1000.0, -1.0, 1010.0]; foreach($values as $v) { echo "Checking value: {$v}:\t"; try { check($v); echo "all good. \n"; } catch (\Throwable $e) { echo "failed! {$e->getMessage()}\n"; } }
You have javascript disabled. You will not be able to edit any code.
Value for `_results` contains invalid data `array`