Skip to content
This repository has been archived by the owner on Dec 16, 2019. It is now read-only.

Bitwise concated constants as default param causes zend_mm_heap corruption #495

Closed
sirsnyder opened this issue Oct 6, 2015 · 1 comment

Comments

@sirsnyder
Copy link
Collaborator

Hi @krakjoe, during breakdown of another bug, I came across this one.

const ALL = \ReflectionProperty::IS_PUBLIC | \ReflectionProperty::IS_PROTECTED;

    class ClassInfo
    {
        private static function getClassPropertyNames(string $classname, $view = \ReflectionProperty::IS_PUBLIC | \ReflectionProperty::IS_PROTECTED) {} // causes zend_mm_heap corrupted

//        private static function getClassPropertyNames(string $classname, $view = ALL) {} // fine
    }

    $t = new class extends \Thread
    {
        public function run()
        {
            throw new \Exception('I should not ending up with an zend_mm_heap corrupted');
        }
    };
    $t->start();
    $t->join();

result

Fatal error: Uncaught Exception: I should not ending up with an zend_mm_heap corrupted in D:\sandbox\v3_tests\bug2\bug2.php:17
Stack trace:
#0 [internal function]: class@anonymous->run()
#1 {main}

thrown in D:\sandbox\v3_tests\bug2\bug2.php on line 17
zend_mm_heap corrupted


php_pthreads-3.0.7-7.0-ts-vc14-x64
php 7 RC 4
win 7 x64

krakjoe added a commit that referenced this issue Oct 7, 2015
@krakjoe
Copy link
Owner

krakjoe commented Oct 7, 2015

Thanks for the report ;)

@krakjoe krakjoe closed this as completed Oct 7, 2015
krakjoe added a commit that referenced this issue Oct 7, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants