|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-07-02 23:11 UTC] sniper@php.net
[2007-07-03 10:01 UTC] kulakov74 at yandex dot ru
[2007-07-03 10:04 UTC] kulakov74 at yandex dot ru
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Nov 13 04:00:01 2025 UTC |
Description: ------------ When I call mysql_free_result($Res) I expect I won't be able to use the result in calls to mysql_fetch_array() etc. But if $Res is passed by reference as a function parameter and is copied to another variable the result is not freed and I can still use it. I realize this is a VERY unlikely condition and I found it by accident (mixed 2 lines of code and got surprised to see no error). Also this might well be intentional behavior. Anyway, just in case. Reproduce code: --------------- a($Res); function a(&$Res){ $Res=mysql_query("Show Tables"); $Res1=$Res; mysql_free_result($Res); mysql_fetch_array($Res); //still works! } Expected result: ---------------- Warning: mysql_fetch_array(): 7 is not a valid MySQL result resource in Actual result: -------------- No errors