Edit report at https://bugs.php.net/bug.php?id=60809&edit=1

 ID:                 60809
 Updated by:         larue...@php.net
 Reported by:        micronix at gmx dot net
 Summary:            TRAITS - PHPDoc Comment Style Bug
 Status:             Critical
 Type:               Bug
 Package:            *General Issues
 Operating System:   Windows
 PHP Version:        5.4.0RC5
 Assigned To:        pierrick
 Block user comment: N
 Private report:     N

 New Comment:

pierrick, I suggest doing like:
char *doccomment = NULL;

if () {
   doccomment = estrndup();
}

thanks :)


Previous Comments:
------------------------------------------------------------------------
[2012-01-20 02:21:52] pierr...@php.net

Problem is because zend_do_traits_property_binding use zend_declare_property_ex 
without doing a estrndup of the doc_comment. I attached a patch please Stas or 
dsp confirm that I can commit it :)

------------------------------------------------------------------------
[2012-01-20 02:19:54] pierr...@php.net

The following patch has been added/updated:

Patch Name: 60809.diff
Revision:   1327025994
URL:        
https://bugs.php.net/patch-display.php?bug=60809&patch=60809.diff&revision=1327025994

------------------------------------------------------------------------
[2012-01-19 23:49:26] g...@php.net

Micronix was just a bit sloppy with typos etc.
I tested on a trunk from 14th of Jan.:

//doc.php
<?php
trait ExampleTrait {
   /**
    *
    */
   public $hello_world = 'hello World ^^';
}


//doctest.php
<?php
include('doc.php');
class Example {
  use ExampleTrait;

  public function __construct()
  {
      echo $this->hello_world;
  }
}

------------------------------------------------------------------------
[2012-01-19 23:43:54] s...@php.net

Could you post what's in your doctest.php exactly?

------------------------------------------------------------------------
[2012-01-19 18:48:32] g...@php.net

I can confirm that.

smarr:~/svn/trunk$ sapi/cli/php  doctest.php 
[Thu Jan 19 19:45:13 2012]  Script:  'doctest.php'
---------------------------------------
/Users/smarr/Projects/PHP-Traits/svn/trunk/Zend/zend_compile.c(131) : Block 
0x1007c60e8 status:
Beginning:      Cached
Freed (invalid)
    Start:      OK
      End:      OK
---------------------------------------


Looks like zend_destroy_property_info thinks it should free something, which 
might 
already have been freed.

Won't have time to look into that before the weekend.
Sorry.

------------------------------------------------------------------------


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    https://bugs.php.net/bug.php?id=60809


-- 
Edit this bug report at https://bugs.php.net/bug.php?id=60809&edit=1

Reply via email to