3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
$like_post_num = 13; $hate_post_num = 10; $total = $like_post_num + $hate_post_num; $like_post_percent = round($like_post_num / $total * 100); $hate_post_percent = round($hate_post_num / $total * 100); <div class="dislike_base"> <div class="like" style="width: <?php echo $like_post_percent ?>%"></div> <div class="like" style="width: <?php echo $hate_post_percent ?>%"></div> </div>
Output for 5.5.0 - 5.6.21, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
$like_post_num = 13; $hate_post_num = 10; $total = $like_post_num + $hate_post_num; $like_post_percent = round($like_post_num / $total * 100); $hate_post_percent = round($hate_post_num / $total * 100); <div class="dislike_base"> <div class="like" style="width: Notice: Undefined variable: like_post_percent in /in/IIX6W on line 9 %"></div> <div class="like" style="width: Notice: Undefined variable: hate_post_percent in /in/IIX6W on line 10 %"></div> </div>
Output for 4.3.0 - 5.4.45
$like_post_num = 13; $hate_post_num = 10; $total = $like_post_num + $hate_post_num; $like_post_percent = round($like_post_num / $total * 100); $hate_post_percent = round($hate_post_num / $total * 100); <div class="dislike_base"> <div class="like" style="width: %"></div> <div class="like" style="width: %"></div> </div>