3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $options = "onclick=\"double_list_move(\$('one'), \$('two')); return false;\""; if (!isset($options['alt'])) { $path_pos = strrpos($source, '/'); $dot_pos = strrpos($source, '.'); $begin = $path_pos ? $path_pos + 1 : 0; $nb_str = ($dot_pos ? $dot_pos : strlen($source)) - $begin; $options['alt'] = ucfirst(substr($source, $begin, $nb_str)); } echo $options; ?>
based on YKE2s
Output for 7.1.0 - 7.2.0
Notice: Undefined variable: source in /in/Wn2W6 on line 7 Notice: Undefined variable: source in /in/Wn2W6 on line 8 Notice: Undefined variable: source in /in/Wn2W6 on line 10 Notice: Undefined variable: source in /in/Wn2W6 on line 11 Warning: Illegal string offset 'alt' in /in/Wn2W6 on line 11 Warning: Cannot assign an empty string to a string offset in /in/Wn2W6 on line 11 onclick="double_list_move($('one'), $('two')); return false;"
Output for 5.4.0 - 7.0.20
Notice: Undefined variable: source in /in/Wn2W6 on line 7 Notice: Undefined variable: source in /in/Wn2W6 on line 8 Notice: Undefined variable: source in /in/Wn2W6 on line 10 Notice: Undefined variable: source in /in/Wn2W6 on line 11 Warning: Illegal string offset 'alt' in /in/Wn2W6 on line 11 nclick="double_list_move($('one'), $('two')); return false;"
Output for 5.3.19 - 5.3.29
onclick="double_list_move($('one'), $('two')); return false;"