Skip to content

Commit

Permalink
Validates that #63 fixes the frame browsing bug in PHP7
Browse files Browse the repository at this point in the history
  • Loading branch information
BitOne committed Aug 7, 2018
1 parent 4f887e4 commit 4fd400a
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 4fd400a

Please sign in to comment.