Skip to content

Commit 9cad20e

Browse files
committed
PhpInterpreter: skips error messages and finds begin of serialized data
1 parent b5cf866 commit 9cad20e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Runner/PhpInterpreter.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,9 @@ public function __construct($path, array $args = [])
6969

7070
$parts = explode("\r\n\r\n", $output, 2);
7171
$this->cgi = count($parts) === 2;
72-
if (!($this->info = @unserialize($parts[$this->cgi]))) {
72+
$this->info = @unserialize(strstr($parts[$this->cgi], 'O:8:"stdClass"'));
73+
$this->error .= strstr($parts[$this->cgi], 'O:8:"stdClass"', TRUE);
74+
if (!$this->info) {
7375
throw new \Exception("Unable to detect PHP version (output: $output).");
7476

7577
} elseif ($this->info->hhvmVersion && version_compare($this->info->hhvmVersion, '3.3.0', '<')) {

0 commit comments

Comments
 (0)