Annotation of embedaddon/php/ext/standard/tests/array/extract_safety.phpt, revision 1.1

1.1     ! misho       1: --TEST--
        !             2: Test extract() for overwrite of GLOBALS
        !             3: --FILE--
        !             4: <?php
        !             5: $str = "John";
        !             6: debug_zval_dump($GLOBALS["str"]);
        !             7: 
        !             8: /* Extracting Global Variables */
        !             9: $splat = array("foo" => "bar");
        !            10: var_dump(extract(array("GLOBALS" => $splat, EXTR_OVERWRITE)));
        !            11: 
        !            12: unset ($splat);
        !            13: 
        !            14: debug_zval_dump($GLOBALS["str"]);
        !            15: 
        !            16: echo "\nDone";
        !            17: ?>
        !            18: 
        !            19: --EXPECTF--
        !            20: string(4) "John" refcount(2)
        !            21: int(0)
        !            22: string(4) "John" refcount(2)
        !            23: 
        !            24: Done

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