Re: [VOTE]strn(case)cmp supporting a negative length as its third paramter

From: Date: Sun, 14 Aug 2011 18:21:14 +0000
Subject: Re: [VOTE]strn(case)cmp supporting a negative length as its third paramter
References: 1 2 3 4 5 6 7 8  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
Hi!

imo the patch is consistent with how substr works: tyrael@thor:~$ php -d display_errors=1 -d error_reporting=-1 -r 'echo substr("prefix_num", -100);' prefix_num
Maybe, but I would classify *that* as a bug as it makes no sense at all.
It makes some sense, if you take the meaning of argument as "at most 100 characters". I'm not sure how useful it'd be backwards, but forward something like "at most 100 chars" is very useful and warning, on the contrary, in such situation would be useless and annoying. Why not make backwards case symmetrical? -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227

Thread (33 messages)

« previous php.internals (#54588) next »