Req #66212 [NEW]: func-num-args, func-get-arg, func-get-args
| From: | Koman at koman dot com dot au | Date: | Sun, 01 Dec 2013 09:22:18 +0000 |
| Subject: | Req #66212 [NEW]: func-num-args, func-get-arg, func-get-args | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-183038@lists.php.net to get a copy of this message | ||
From: Koman at koman dot com dot au
Operating system: Linux
PHP version: Irrelevant
Package: Built-in web server
Bug Type: Feature/Change Request
Bug description:func-num-args, func-get-arg, func-get-args
Description:
------------
---
From manual page: http://www.php.net/function.func-num-args
From manual page: http://www.php.net/function.func-get-arg
From manual page: http://www.php.net/function.func-get-args
---
As indicated in the documentation, versions after 5.3.0 generates a
warning and returns -1 when used from within an include or require
call.
Because, I've found these functions really useful for generating debug
files in complex algorythms in variable data sets, I think you should
return back to the functionality prior to versions 5.3.0.
Or, alternatively, organise someting along the lines of :-
Test script:
---------------
<?php
function test_function ( &$data_list ) {
static $function_name_or_handle = __FUNCTION__;
$debug_data = array ();
include ( vars_initial.php );
. . test algorythm . .
include ( vars_final.php );
}
?>
vars_initial.php and vars_final.php would utilise :-
func-num-args ( [ $function_name_or_handle ] );
func_get_arg ( $arg_num, [ $function_name_or_handle ] );
func_get_args ( [ $function_name_or_handle ] );
to generate data that is used to compile a debug report.
If no $function_name_or_handle is supplied then the current function is
used or a warning is generated when called from within an include or
require call.
Expected result:
----------------
To be able to generate valid data from :-
func-num-args ();
func_get_arg ();
func_get_args ();
when called from within a include or require construct.
Actual result:
--------------
Error/Warning Messages.
--
Edit bug report at https://bugs.php.net/bug.php?id=66212&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=66212&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=66212&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=66212&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=66212&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=66212&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=66212&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=66212&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=66212&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=66212&r=support
Expected behavior: https://bugs.php.net/fix.php?id=66212&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=66212&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=66212&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=66212&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=66212&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=66212&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=66212&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=66212&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=66212&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=66212&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=66212&r=mysqlcfg