-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
I was using these a while back ,and they're kinda useful, so I may as…
… well commit them. If you run: misc/phcdiff --run-shredder --run-goto-uppering a.php it will run diff the output of php on the original file and php on the shredded file. You can use any options, as long as the filename goes last. xmldiff shreds both and diffs the output. If we break these in the future its no harm, but the'yer a smidgeon useful.
- Loading branch information
Showing
2 changed files
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,16 @@ | ||
#!/usr/bin/env php | ||
<?php | ||
|
||
# Run phc with all specified agruments, using the last argument as a | ||
# filename. Pretty print it, run it through php and compare it to the output | ||
# of php | ||
dl("xdiff.so"); | ||
|
||
unset ($argv[0]); | ||
$file = array_pop ($argv); | ||
$args = join (" ", $argv); | ||
|
||
$result1 = `src/phc --pretty-print $args $file | php`; | ||
$result2 = `php $file`; | ||
echo xdiff_string_diff ($result1, $result2); | ||
?> |
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,16 @@ | ||
#!/usr/bin/env php | ||
<?php | ||
|
||
# Run phc with all specified agruments, using the last argument as a | ||
# filename. Compare its xml output with its xmloutput without any flags | ||
# of php | ||
dl("xdiff.so"); | ||
|
||
unset ($argv[0]); | ||
$file = array_pop ($argv); | ||
$args = join (" ", $argv); | ||
|
||
$result1 = `src/phc --dump-ast-xml $args $file`; | ||
$result2 = `src/phc --dump-ast-xml $file`; | ||
echo xdiff_string_diff ($result1, $result2); | ||
?> |