Part of Slepp's ProjectsPastebinTURLImagebinFilebin
Feedback -- English French German Japanese
Create Upload Newest Tools Donate
Sign In | Create Account

robin
Tuesday, February 19th, 2008 at 8:04:48pm UTC 

  1. diff -Naur php6.0-200802191530.orig\ext\standard/array.c php6.0-200802191530\ext\standard/array.c
  2. --- php6.0-200802191530.orig\ext\standard/array.c       2008-02-15 11:30:22.000000000 +0000
  3. +++ php6.0-200802191530\ext\standard/array.c    2008-02-19 19:11:16.046875000 +0000
  4. @@ -1509,18 +1509,13 @@
  5.                       if (extract_refs) {
  6.                              zval **orig_var;
  7.  
  8. +                            SEPARATE_ZVAL_TO_MAKE_IS_REF(entry);
  9. +                            zval_add_ref(entry);
  10. +
  11.                              if (zend_u_hash_find(EG(active_symbol_table), Z_TYPE(final_name), Z_UNIVAL(final_name), Z_UNILEN(final_name) + 1, (void **) &orig_var) == SUCCESS) {
  12. -                                   SEPARATE_ZVAL_TO_MAKE_IS_REF(entry);
  13. -                                   zval_add_ref(entry);
  14.                                     zval_ptr_dtor(orig_var);
  15.                                     *orig_var = *entry;
  16.                              } else {
  17. -                                   if (Z_REFCOUNT_P(var_array) > 1 || *entry == EG(uninitialized_zval_ptr)) {
  18. -                                          SEPARATE_ZVAL_TO_MAKE_IS_REF(entry);
  19. -                                   } else {
  20. -                                          Z_SET_ISREF_PP(entry);
  21. -                                   }
  22. -                                   zval_add_ref(entry);
  23.                                     zend_u_hash_update(EG(active_symbol_table), Z_TYPE(final_name), Z_UNIVAL(final_name), Z_UNILEN(final_name) + 1, (void **) entry, sizeof(zval *), NULL);
  24.                              }
  25.                       } else {
  26. diff -Naur php6.0-200802191530.orig\ext\standard/basic_functions.c php6.0-200802191530\ext\standard/basic_functions.c
  27. --- php6.0-200802191530.orig\ext\standard/basic_functions.c     2008-02-03 15:23:22.000000000 +0000
  28. +++ php6.0-200802191530\ext\standard/basic_functions.c  2008-02-19 18:44:20.656250000 +0000
  29. @@ -368,7 +368,7 @@
  30.  
  31.  static
  32.  ZEND_BEGIN_ARG_INFO_EX(arginfo_extract, 0, 0, 1)
  33. -       ZEND_ARG_INFO(0, arg) /* ARRAY_INFO(0, arg, 0) */
  34. +       ZEND_ARG_INFO(ZEND_SEND_PREFER_REF, arg) /* ARRAY_INFO(0, arg, 0) */
  35.         ZEND_ARG_INFO(0, extract_type)
  36.         ZEND_ARG_INFO(0, prefix)
  37.  ZEND_END_ARG_INFO()
  38. diff -Naur php6.0-200802191530.orig\ext\standard/tests/array/extract_variation10.phpt php6.0-200802191530\ext\standard/tests/array/extract_variation10.phpt
  39. --- php6.0-200802191530.orig\ext\standard/tests/array/extract_variation10.phpt  1970-01-01 00:00:00.000000000 +0000
  40. +++ php6.0-200802191530\ext\standard/tests/array/extract_variation10.phpt       2008-02-19 19:29:17.078125000 +0000
  41. @@ -0,0 +1,15 @@
  42. +--TEST--
  43. +Test extract() function - ensure EXTR_REFS doesn't mess with isRef flag on COW references to array elements. 
  44. +--FILE--
  45. +<?php
  46. +$a = array('foo' => 'original.foo');
  47. +$nonref = $a['foo'];
  48. +$ref = &$a;
  49. +extract($a, EXTR_REFS);
  50. +$a['foo'] = 'changed.foo';
  51. +var_dump($nonref);
  52. +?>
  53. +--EXPECTF--
  54. +string(12) "original.foo"
  55. +--UEXPECTF--
  56. +unicode(12) "original.foo"
  57. \ No newline at end of file
  58. diff -Naur php6.0-200802191530.orig\ext\standard/tests/array/extract_variation11.phpt php6.0-200802191530\ext\standard/tests/array/extract_variation11.phpt
  59. --- php6.0-200802191530.orig\ext\standard/tests/array/extract_variation11.phpt  1970-01-01 00:00:00.000000000 +0000
  60. +++ php6.0-200802191530\ext\standard/tests/array/extract_variation11.phpt       2008-02-19 19:29:27.375000000 +0000
  61. @@ -0,0 +1,15 @@
  62. +--TEST--
  63. +Test extract() function - ensure EXTR_REFS works when array is referenced and keys clash with variables in current scope.
  64. +--FILE--
  65. +<?php
  66. +$a = array('foo' => 'original.foo');
  67. +$ref = &$a;
  68. +$foo = 'test';
  69. +extract($a, EXTR_OVERWRITE|EXTR_REFS);
  70. +$foo = 'changed.foo';
  71. +var_dump($a['foo']);
  72. +?>
  73. +--EXPECTF--
  74. +string(11) "changed.foo"
  75. +--UEXPECTF--
  76. +unicode(11) "changed.foo"
  77. \ No newline at end of file

Update the Post

Either update this post and resubmit it with changes, or make a new post.

You may also comment on this post.

update paste below
details of the post (optional)

Note: Only the paste content is required, though the following information can be useful to others.

Save name / title?

(space separated, optional)



Please note that information posted here will expire by default in one month. If you do not want it to expire, please set the expiry time above. If it is set to expire, web search engines will not be allowed to index it prior to it expiring. Items that are not marked to expire will be indexable by search engines. Be careful with your passwords. All illegal activities will be reported and any information will be handed over to the authorities, so be good.

comments powered by Disqus
worth-right
worth-right