3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php echo"<script language='javascript'> (function ($) /* Wraps this `$ = jQuery` routine. */ { $.fn.swapWith = function (to) /* Utility extension for jQuery. */ { return this.each(function () { var $to = $(to).clone(true), $from = $(this).clone(true); $(to).replaceWith($from), $(this).replaceWith($to); }); }; /**/ $(document).ready(function () /* Handles email-to-username on keyup. */ { var email = 'input#user_email', login = 'input#user_login'; $(email).closest('p').swapWith($(login).closest('p')), $(email).keyup(function () { $(login).val($.trim($(email).val().split(/@/)[0].replace(/[^\w]/gi, ''))); }); }); })(jQuery); </script> "; ?>
based on 7Cdia
Output for 7.0.0 - 7.2.0
Notice: Undefined variable: to in /in/SnlaB on line 8 Notice: Undefined variable: from in /in/SnlaB on line 9 Notice: Undefined variable: from in /in/SnlaB on line 10 Notice: Undefined variable: to in /in/SnlaB on line 10 <script language='javascript'> (function ($) /* Wraps this `$ = jQuery` routine. */ { $.fn.swapWith = function (to) /* Utility extension for jQuery. */ { return this.each(function () { var = $(to).clone(true), = $(this).clone(true); $(to).replaceWith(), $(this).replaceWith(); }); }; /**/ $(document).ready(function () /* Handles email-to-username on keyup. */ { var email = 'input#user_email', login = 'input#user_login'; $(email).closest('p').swapWith($(login).closest('p')), $(email).keyup(function () { $(login).val($.trim($(email).val().split(/@/)[0].replace(/[^\w]/gi, ''))); }); }); })(jQuery); </script>
Output for 5.3.18 - 5.6.28
Notice: Undefined variable: to in /in/SnlaB on line 9 Notice: Undefined variable: from in /in/SnlaB on line 10 Notice: Undefined variable: from in /in/SnlaB on line 10 Notice: Undefined variable: to in /in/SnlaB on line 23 <script language='javascript'> (function ($) /* Wraps this `$ = jQuery` routine. */ { $.fn.swapWith = function (to) /* Utility extension for jQuery. */ { return this.each(function () { var = $(to).clone(true), = $(this).clone(true); $(to).replaceWith(), $(this).replaceWith(); }); }; /**/ $(document).ready(function () /* Handles email-to-username on keyup. */ { var email = 'input#user_email', login = 'input#user_login'; $(email).closest('p').swapWith($(login).closest('p')), $(email).keyup(function () { $(login).val($.trim($(email).val().split(/@/)[0].replace(/[^\w]/gi, ''))); }); }); })(jQuery); </script>