3v4l.org

run code in 300+ PHP versions simultaneously
$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 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
$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: Warning: Undefined variable $like_post_percent in /in/IIX6W on line 9 %"></div> <div class="like" style="width: Warning: Undefined variable $hate_post_percent in /in/IIX6W on line 10 %"></div> </div>
Output for 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.40, 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.31, 7.4.0 - 7.4.25, 7.4.27 - 7.4.33
$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 - 4.3.11, 4.4.0 - 4.4.9, 5.0.0 - 5.0.5, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17, 7.3.32 - 7.3.33, 7.4.26
$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>

preferences:
343.26 ms | 403 KiB | 460 Q