-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #69 from BitOne/GITHUB-67_php7_wrong_exec_frame_test
Validates that #63 fixes the frame browsing bug in PHP7
- Loading branch information
Showing
1 changed file
with
32 additions
and
0 deletions.
There are no files selected for viewing
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
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() |