File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / tests / lang / bug21600.phpt
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Tue Feb 21 23:48:06 2012 UTC (12 years, 4 months ago) by misho
Branches: php, MAIN
CVS tags: v5_4_3elwix, v5_4_29p0, v5_4_29, v5_4_20p0, v5_4_20, v5_4_17p0, v5_4_17, v5_3_10, HEAD
php

    1: --TEST--
    2: Bug #21600 (assign by reference function call changes variable contents)
    3: --INI--
    4: error_reporting=4095
    5: --FILE--
    6: <?php
    7: $tmp = array();
    8: $tmp['foo'] = "test";
    9: $tmp['foo'] = &bar($tmp['foo']);
   10: var_dump($tmp);
   11: 
   12: unset($tmp);
   13: 
   14: $tmp = array();
   15: $tmp['foo'] = "test";
   16: $tmp['foo'] = &fubar($tmp['foo']);
   17: var_dump($tmp);
   18: 
   19: function bar($text){
   20:   return $text;
   21: }
   22: 
   23: function fubar($text){
   24:   $text = &$text;
   25:   return $text;
   26: }
   27: ?>
   28: --EXPECTF--
   29: Strict Standards: Only variables should be assigned by reference in %sbug21600.php on line 4
   30: array(1) {
   31:   ["foo"]=>
   32:   string(4) "test"
   33: }
   34: 
   35: Strict Standards: Only variables should be assigned by reference in %sbug21600.php on line 11
   36: array(1) {
   37:   ["foo"]=>
   38:   string(4) "test"
   39: }

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>