|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-11-25 19:48 UTC] jani@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 29 01:00:01 2025 UTC |
Description: ------------ If the start value is lower then the max value, you should get one result even if the step makes it unable to return 2 values. Instead of $list = range($i * 2, TOP, $i); I have to write if (TOP > ($i * 3)) $list = range($i * 2, TOP, $i); else $list = array($i * 2); could not even use $list = @range($i * 2, TOP, $i) or array($i * 2); Reproduce code: --------------- print_r(range(6, 8, 3)); Expected result: ---------------- Array ( [0] => 6 ) Actual result: -------------- Warning: range(): step exceeds the specified range