|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2019-10-19 12:02 UTC] cmb@php.net
-Status: Open
+Status: Suspended
[2019-10-19 12:02 UTC] cmb@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 21:00:01 2025 UTC |
Description: ------------ [ FEATURE REQUEST ] [ NOT A BUG ] uint - unsigned int (0,1,2,3) ufloat - unsigned float resource (replace to opened OR closed resource) stack (array w/ordered ("default") int keys 0,1,2,3) list (array w/non-ordered int keys 1,4,3,0) assoc (array w/both int/string keys but fatal if only int/only string keys) dict (array w/string keys) + - non-empty resource+ (opened resource) int+ (1,2,3... but fatal if 0) float+ (0.01, 0.02 but fatal if 0.0) string+ (at least one letter or fatal) array+ (at least one item or fatal) would be great to but not so required string[] // list(!) of strings Object[] // list(!) of objects and i know that will be implemented in 7.4 - co-return 'string|array', 'OneInterface|TwoInterface' Test script: --------------- function hello(? int $limit) { // damn i need this every time $limit = max(0, $limit); if (0 === $limit) throw \InvalidArgumentException('Error'); // yes, i can: $limit = max(1, $limit); // and somewhere i could expect fatal error if 0 is going from another function, but this function wont throw and will work like 1 passed } Expected result: ---------------- Reduce count of if/elses + exceptions required when you writing simple scripts (usually required by Saas flow) Actual result: -------------- tonns of "if/else" making properties to separate objects to "true OOP" and then projects with 1500 files... instead of 100.