[PHP-QA] [PHP-BUG] Req #67210 [NEW]: This is a core php feature update request

2014-05-05 Thread mrdaniellee2020 at gmail dot com
From: mrdaniellee2020 at gmail dot com
Operating system: All
PHP version:  Irrelevant
Package:  Testing related
Bug Type: Feature/Change Request
Bug description:This is a core php feature update request

Description:

Hi,

Earlier today i was reading about the newly release Facebook Hack
Languages and Tools online with this they have added a few new features
which are quite interesting.

However there was one feature they added which i had already thought of
in the past which i thought would be excellent if php had this installed
by default.

Its literally to check return values of methods and classes in order to
check returned values just as easily as you can check input values.

I wrote a quick class explaining exactly this.
I think it would be useful to have by default in php as i think it would
help to trim down php unit testing massively.

All this class simple does is allow you to check the response / return
value of a function to ensure the correct data type is returned,
otherwise it throws an exception.

Please review my test script below and tell me what you think?
Im sure if this was placed in the core the actual syntax of the call
could be shortend to something like return('string', '1234'); or
similar.


Test script:
---
https://bugs.php.net/bug.php?id=67210&edit=1
-- 
Try a snapshot (PHP 5.4):   
https://bugs.php.net/fix.php?id=67210&r=trysnapshot54
Try a snapshot (PHP 5.5):   
https://bugs.php.net/fix.php?id=67210&r=trysnapshot55
Try a snapshot (trunk): 
https://bugs.php.net/fix.php?id=67210&r=trysnapshottrunk
Fixed in SVN:   https://bugs.php.net/fix.php?id=67210&r=fixed
Fixed in release:   https://bugs.php.net/fix.php?id=67210&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=67210&r=needtrace
Need Reproduce Script:  https://bugs.php.net/fix.php?id=67210&r=needscript
Try newer version:  https://bugs.php.net/fix.php?id=67210&r=oldversion
Not developer issue:https://bugs.php.net/fix.php?id=67210&r=support
Expected behavior:  https://bugs.php.net/fix.php?id=67210&r=notwrong
Not enough info:
https://bugs.php.net/fix.php?id=67210&r=notenoughinfo
Submitted twice:
https://bugs.php.net/fix.php?id=67210&r=submittedtwice
register_globals:   https://bugs.php.net/fix.php?id=67210&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=67210&r=php4
Daylight Savings:   https://bugs.php.net/fix.php?id=67210&r=dst
IIS Stability:  https://bugs.php.net/fix.php?id=67210&r=isapi
Install GNU Sed:https://bugs.php.net/fix.php?id=67210&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=67210&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=67210&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=67210&r=mysqlcfg


-- 
PHP Quality Assurance Mailing List 
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-QA] Req #67210 [Opn->Nab]: This is a core php feature update request

2014-05-05 Thread johannes
Edit report at https://bugs.php.net/bug.php?id=67210&edit=1

 ID: 67210
 Updated by: johan...@php.net
 Reported by:mrdaniellee2020 at gmail dot com
 Summary:This is a core php feature update request
-Status: Open
+Status: Not a bug
 Type:   Feature/Change Request
 Package:Testing related
 Operating System:   All
 PHP Version:Irrelevant
 Block user comment: N
 Private report: N

 New Comment:

Return type handling is discussed as part of this RFC: 
https://wiki.php.net/rfc/returntypehinting

No need for extra bug tracker item.


Previous Comments:

[2014-05-05 14:24:04] mrdaniellee2020 at gmail dot com

Description:

Hi,

Earlier today i was reading about the newly release Facebook Hack Languages and 
Tools online with this they have added a few new features which are quite 
interesting.

However there was one feature they added which i had already thought of in the 
past which i thought would be excellent if php had this installed by default.

Its literally to check return values of methods and classes in order to check 
returned values just as easily as you can check input values.

I wrote a quick class explaining exactly this.
I think it would be useful to have by default in php as i think it would help 
to trim down php unit testing massively.

All this class simple does is allow you to check the response / return value of 
a function to ensure the correct data type is returned, otherwise it throws an 
exception.

Please review my test script below and tell me what you think?
Im sure if this was placed in the core the actual syntax of the call could be 
shortend to something like return('string', '1234'); or similar.


Test script:
---
https://bugs.php.net/bug.php?id=67210&edit=1

-- 
PHP Quality Assurance Mailing List 
To unsubscribe, visit: http://www.php.net/unsub.php