php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #13477 gethostbyname() result broken if used same variable as argument
Submitted: 2001-09-28 06:45 UTC Modified: 2001-09-28 08:01 UTC
From: khimich at ukr dot net Assigned:
Status: Closed Package: Network related
PHP Version: 4.0CVS-2001-09-28 OS: FreeBSD 4.3
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
50 + 49 = ?
Subscribe to this entry?

 
 [2001-09-28 06:45 UTC] khimich at ukr dot net
This expression returns corrupted value:

  $host=gethostbyname($host);

This variant is good:

  $temp=gethostbyname($host);
  $host=$temp;

Even this:
  $host=$temp=gethostbyname($host);

Return two corrupted values for $temp and $host

Oleg Khimich.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-09-28 07:02 UTC] derick@php.net
I could not reproduce this with PHP 4.0.3/OpenBSD, PHP 4.0.6/Linux, PHP 4.0.7RC2/Linux or latest CVS/Linux...

Can you please post the whole script, and possible can you show us the failing script on a webserver?

Derick
 [2001-09-28 07:46 UTC] derick@php.net
Also tried it on php 4.0.8dev on FreeBSD 4.3. Works fine too.

Derick
 [2001-09-28 08:01 UTC] khimich at ukr dot net
Seems that I can't reproduce this on simple scripts too.
I've stable errors on my complex site. This script uses two nested functions with includes. In one include I'm used gethostname() and it broke my variable.

So, I'm closing this bug, because I can't reproduce all of my code.

Oleg Khimich.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Apr 24 23:01:34 2024 UTC