php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #20711 ressource id are incorrect
Submitted: 2002-11-29 02:38 UTC Modified: 2002-11-29 07:10 UTC
From: f dot labanvoye at cg70 dot fr Assigned:
Status: Not a bug Package: Unknown/Other Function
PHP Version: 4.3.0RC2 OS: Windows 2000 and linux
Private report: No CVE-ID: None
 [2002-11-29 02:38 UTC] f dot labanvoye at cg70 dot fr
First, I notice that the ressource id given by some function is always greater or egal to 2 with php-4.3.0RC1 and 4.3.0RC2. 

script:
<?php  
$ds = ldap_connect ( $ldaphost );
echo $ds;
?>

output:
ressource id #2

Second, the ressource id is always increased even if the function failed. ie

script:
<?php
$fp = fopen ( 'not_existing_file', 'r');
echo '-'.$fp.'-<br>';

$ds = ldap_connect ( $ldaphost );
echo '-'.$ds.'-';
?>

output:
--
-ressource id#3-

Thanks

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-11-29 02:46 UTC] derick@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php
 [2002-11-29 03:14 UTC] f dot labanvoye at cg70 dot fr
Sorry, but it's bugs.

I know that i should send only 1 bug per submission but the solution for both bug concern the same part of code (in my opinion) and the first bug (resource id >=2) is a very little bug to solve.

So, i think you should take a little more time to answers bug report and/or give a better reason for a reject.

Thanks
 [2002-11-29 07:10 UTC] wez@php.net
The ID numbers assigned to PHP are internal to PHP and the Zend Engine; your scripts should not make any assumptions about the numbers or the apparent sequence of allocation; to do so is to write a buggy PHP script.
Just don't do it :)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Jul 01 20:01:31 2024 UTC