![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/mautic.corals.io/vendor/mustangostang/spyc/php4/ |
<?php php5to4 ("../spyc.php", 'spyc-latest.php4'); function php5to4 ($src, $dest) { $code = file_get_contents ($src); $code = preg_replace ('#(public|private|protected)\s+\$#i', 'var \$', $code); $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); fclose ($f); print "Written to $dest.\n"; }