ollyxar / http-router

Simple PHP Extension for HTTP routes
MIT License
12 stars 3 forks source link

mac php7.2 error #1

Closed aizxin closed 5 years ago

aizxin commented 5 years ago
<?php
class Route extends HTTPRouter {
    public function get($pattern, $action) {
        return $this->method('GET', $pattern, $action);
    }
    public function post($pattern, $action) {
        return $this->method('POST', $pattern, $action);
    }
}

$router = new Route('/custom-uri/sub/99?param=val', 'POST');

$router->group('custom-uri', function() use ($router) {
    echo 1;
    $router->group('sub', function() use ($router) {
        echo 2;
        $router->post('{id}', function($id) {
            return $id;
        });
    });
});

echo $router->action();

php bin/swf.php 
1299
error:
php(26172,0x1173925c0) malloc: *** error for object 0x7ffc65aa5131: pointer being freed was not allocated
php(26172,0x1173925c0) malloc: *** set a breakpoint in malloc_error_break to debug
Abort trap: 6
alexslipknot commented 5 years ago

I checked out tag php-7.2.21 and tested your snippet. Everything ok. I cannot reproduce this error. If you have any additional info please provide it. Maybe we can reproduce it by installing some additional components inside Dockerfile?