Skip to content

Commit

Permalink
I was using these a while back ,and they're kinda useful, so I may as…
Browse files Browse the repository at this point in the history
… 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
pbiggar committed Jun 7, 2007
1 parent f6cd9b3 commit 14dc530
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
16 changes: 16 additions & 0 deletions misc/phcdiff
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);
?>
16 changes: 16 additions & 0 deletions misc/xmldiff
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);
?>

0 comments on commit 14dc530

Please sign in to comment.