Skip to content

Commit

Permalink
Merge pull request #69 from BitOne/GITHUB-67_php7_wrong_exec_frame_test
Browse files Browse the repository at this point in the history
Validates that #63 fixes the frame browsing bug in PHP7
  • Loading branch information
BitOne authored Aug 8, 2018
2 parents 4f887e4 + 4fd400a commit 63fd85a
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions extension/php7/tests/bug-git-63_php7_wrong_exec_fame.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
--TEST--
Check that we have the right frame name on PHP 7
--SKIPIF--
<?php
if (!extension_loaded('json')) die('skip json ext not loaded');
?>
--FILE--
<?php
$dump = fopen('php://memory', 'rw');

function myTestFunction() {
global $dump;
$myVariableInsideAFunction = 'test';

meminfo_dump($dump);
}

myTestFunction();

rewind($dump);
$meminfoData = json_decode(stream_get_contents($dump), true);
fclose($dump);

foreach($meminfoData['items'] as $item) {
if (isset($item['symbol_name']) && $item['symbol_name'] === 'myVariableInsideAFunction') {
echo 'Frame for '.$item['symbol_name'].': '.$item['frame']."\n";
}
}

?>
--EXPECT--
Frame for myVariableInsideAFunction: myTestFunction()

0 comments on commit 63fd85a

Please sign in to comment.