-
-
Save anonymous/7f465d4109d667a73984 to your computer and use it in GitHub Desktop.
PHP 5.5 Segfault
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Test | |
{ | |
public static function a($path) | |
{ | |
$contents = php_strip_whitespace($path); | |
var_dump('content:'); | |
var_dump($contents); | |
var_dump('test'); | |
var_dump(preg_replace('{.*}s', 'a', $contents)); | |
var_dump('starting'); | |
$contents = preg_replace('{<<<\'?(\w+)\'?(?:\r\n|\n|\r)(?:.*?)(?:\r\n|\n|\r)\\1(?=\r\n|\n|\r|;)}s', 'null', $contents); | |
$contents = preg_replace('{"[^"\\\\]*(\\\\.[^"\\\\]*)*"|\'[^\'\\\\]*(\\\\.[^\'\\\\]*)*\'}', 'null', $contents); | |
var_dump('done'); | |
return $contents; | |
} | |
} | |
var_dump(Test::a(__DIR__.'/testcase.php') === "<?php\n namespace Foo; class StripNoise { public function test() { return null\n; } } "); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Foo; | |
/** | |
* class Fail { } | |
*/ | |
class StripNoise | |
{ | |
public function test() | |
{ | |
return <<<A | |
class Fail23 | |
{ | |
} | |
A | |
; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment