3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo ' $(document).ready(function(){ $(\'.ingBox:first\').hide(); $(\'#plus\').click(function(){ var newbox = $(\'.ingBox:first\').clone(); $(\'#ings\').append(newbox); if($(\'#add_id\').val() in all_ings){ var item = all_ings[$(\'#add_id\').val()]; newbox.find(\'[name="id_ingredient[]"]\').val(item.id_ingredient); newbox.find(\'[name="name[]"]\').attr(\'readonly\',\'readonly\').val(item.name).change(); newbox.find(\'[name="description[]"]\').attr(\'readonly\',\'readonly\').val(item.description); newbox.find(\'[name="cms_name[]"]\').attr(\'readonly\',\'readonly\').val(item.cms_name); } newbox.show(); $(\'#add_id\').val(\'0\'); }); $(\'.left\').live(\'click\', function(){ var that = $(this).parents(\'.ingBox\'); that.fadeOut(\'slow\', function(){ that.prev().before(that); that.fadeIn(); }); }); $(\'.right\').live(\'click\', function(){ var that = $(this).parents(\'.ingBox\'); that.fadeOut(\'slow\', function(){ that.next().after(that); that.fadeIn(); }); }); $(\'.enable\').live(\'click\', function(){ var that = $(this).parents(\'.ingBox\'); that.find(\'[name="id_ingredient[]"]\').val(0); that.find(\'[name="name[]"]\').removeAttr(\'readonly\'); that.find(\'[name="description[]"]\').removeAttr(\'readonly\'); that.find(\'[name="cms_name[]"]\').removeAttr(\'readonly\'); $(this).parent().hide(); }); $(\'.minus\').live(\'click\', function(){ $(this).parents(\'.ingBox\').remove(); }); $(\'.unfold\').live(\'click\', function(){ if($(this).parents(\'.ingBox\').find(\'.col\').is(":visible")){ $(this).parents(\'.ingBox\').find(\'.col\').slideUp(); } else { $(\'.col\').hide(); $(this).parents(\'.ingBox\').find(\'.col\').slideDown(); } }); $(\'[name="name[]"]\').live(\'change\', function(){ $(this).parents(\'.ingBox\').find(\'.buttons span\').text($(this).val()); }); }); ';
Output for git.master, git.master_jit, rfc.property-hooks
$(document).ready(function(){ $('.ingBox:first').hide(); $('#plus').click(function(){ var newbox = $('.ingBox:first').clone(); $('#ings').append(newbox); if($('#add_id').val() in all_ings){ var item = all_ings[$('#add_id').val()]; newbox.find('[name="id_ingredient[]"]').val(item.id_ingredient); newbox.find('[name="name[]"]').attr('readonly','readonly').val(item.name).change(); newbox.find('[name="description[]"]').attr('readonly','readonly').val(item.description); newbox.find('[name="cms_name[]"]').attr('readonly','readonly').val(item.cms_name); } newbox.show(); $('#add_id').val('0'); }); $('.left').live('click', function(){ var that = $(this).parents('.ingBox'); that.fadeOut('slow', function(){ that.prev().before(that); that.fadeIn(); }); }); $('.right').live('click', function(){ var that = $(this).parents('.ingBox'); that.fadeOut('slow', function(){ that.next().after(that); that.fadeIn(); }); }); $('.enable').live('click', function(){ var that = $(this).parents('.ingBox'); that.find('[name="id_ingredient[]"]').val(0); that.find('[name="name[]"]').removeAttr('readonly'); that.find('[name="description[]"]').removeAttr('readonly'); that.find('[name="cms_name[]"]').removeAttr('readonly'); $(this).parent().hide(); }); $('.minus').live('click', function(){ $(this).parents('.ingBox').remove(); }); $('.unfold').live('click', function(){ if($(this).parents('.ingBox').find('.col').is(":visible")){ $(this).parents('.ingBox').find('.col').slideUp(); } else { $('.col').hide(); $(this).parents('.ingBox').find('.col').slideDown(); } }); $('[name="name[]"]').live('change', function(){ $(this).parents('.ingBox').find('.buttons span').text($(this).val()); }); });

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
37.56 ms | 405 KiB | 8 Q