Permalink
Browse files

Fixing issue 21.

git-svn-id: https://spyc.googlecode.com/svn/trunk@101 705174c8-340b-11de-9d05-31133e6853b1
  • Loading branch information...
1 parent c1d53d4 commit 284e1db47ee38de60d63cd5b44912af178d3340f vlad.andersen@gmail.com committed Mar 20, 2011
Showing with 1 addition and 0 deletions.
  1. +1 −0 php4/5to4.php
View
@@ -8,6 +8,7 @@ function php5to4 ($src, $dest) {
$code = preg_replace ('#(public|private|protected)\s+static\s+\$#i', 'var \$', $code);
$code = preg_replace ('#(public|private|protected)\s+function#i', 'function', $code);
$code = preg_replace ('#(public|private|protected)\s+static\s+function#i', 'function', $code);
+ $code = preg_replace ('#throw new Exception\\(([^)]*)\\)#i', 'trigger_error($1,E_USER_ERROR)', $code);
$code = str_replace ('self::', '$this->', $code);
$f = fopen ($dest, 'w');
fwrite($f, $code);

0 comments on commit 284e1db

Please sign in to comment.