| 
        php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits             
             [2007-03-06 10:49 UTC] tony2001@php.net
  [2007-03-06 11:34 UTC] anter at voliacable dot com
  | 
    |||||||||||||||||||||||||||
            
                 
                Copyright © 2001-2025 The PHP GroupAll rights reserved.  | 
        Last updated: Tue Nov 04 12:00:01 2025 UTC | 
Description: ------------ In the Simple::$var property the reference to a variable instead of a copy is located, depending on many conditions. If lines 6 and 8 of bug.php to change places the expected result is received. If to remove a line 7 of bug.php the expected result is received. If remove a line 1 of bug.php and to place contents of a Simple.php in a bug.php the expected result is received. Reproduce code: --------------- <file Simple.php> 1 class Simple 2 { 3 protected static $var; 4 5 public static function setVar($value) 6 { 7 self::$var = $value; 8 } 9 } <file bug.php> 1 require_once('Simple.php'); 2 3 $var1 = 'value1'; 4 $var2 = 'value2'; 5 6 Simple::setVar($var1); 7 8 class VerySimple extends Simple {} 9 10 Simple::setVar($var2); 11 12 print $var1; Expected result: ---------------- value1 Actual result: -------------- value2