Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function compile($data) {
- // Compile variables:
- // var = $value
- //
- // into:
- // $var = $value
- $data = preg_replace('/[a-Z]/im', '');
- // Compile:
- // if $cond
- //
- // into:
- // if ($cond) {
- $data = preg_replace('/if (.*)/im', 'if ($1) {', $data);
- return $data;
- }
- echo compile('if value == 1');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement