OSSP CVS Repository

ossp - Ticket #92
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Attach]  [Edit]  [History

Ticket 92: uuid-1.4.1 PHP 4 interface

The PHP 4 interface included in uuid-1.4.1 produces many runtime warnings for calltime-pass-by-reference occurrences. I have a patch for that at ¤http://codex.sigpipe.cz/misc/OSSP/uuid/ossp-uuid-php4-fix,0.patch (check the directory for newer revisions). It somewhat changes the interface, but there's no other way these warnings could be fixed.

Besides this, the patch fixes a bug in uuid_create():

  -    PHP_FE(uuid_create,  third_arg_force_ref)
  +    PHP_FE(uuid_create,  first_arg_force_ref)
[Append remarks]

Remarks:

Hmmm... the third_arg_force_ref for uuid_create() was a mistake, yes. Fixed. But I like to keep the API as close to the C API as possible (although I know that this way it isn't the most elegant PHP API, of course). Additionally, I do not get these errors, neither with PHP 4 nor PHP 5. Do I have to enable some warnings somewhere? I'm not a PHP expert...


2006-Jun-08 14:01:06 by anonymous:
Use php.ini-recommended or set

  error_reporting = E_ALL
  allow_call_time_pass_reference = Off

I understand your desire to keep the interfaces as close as possible, but PHP is not C. Current code maintains superficial similarity, but the things are not the same.

Declaring a function with byval parameters, and then sometimes calling it with byref is bad style in PHP, and has been suggested against since I remember. Matters of taste aside, the urge to produce library code that's silent with E_ALL is very strong in PHP because of bad interactions with custom error handlers, debuggers, etc.

BTW, thanks for committing #93.

[Append remarks]

Properties:

Type: code           Version: 1.4.1 
Status: review          Created: 2006-Mar-03 13:01
Severity:          Last Change: 2006-May-11 20:41
Priority:          Subsystem: uuid 
Assigned To: rse           Derived From:  
Creator: anonymous 

CVSTrac 2.0.1