3v4l.org

run code in 300+ PHP versions simultaneously
<?php $width = 1; $length = 1; do{ $width++; $length++; $area = $width * $length; echo "the area of the rectangle is $area"; }while($area < 1000); echo "You can't have a rectangle whose area is greater than a square meter";
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, 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.24 - 5.5.35, 5.6.7 - 5.6.28, 7.0.0 - 7.0.20, 7.1.0 - 7.1.25, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
the area of the rectangle is 4the area of the rectangle is 9the area of the rectangle is 16the area of the rectangle is 25the area of the rectangle is 36the area of the rectangle is 49the area of the rectangle is 64the area of the rectangle is 81the area of the rectangle is 100the area of the rectangle is 121the area of the rectangle is 144the area of the rectangle is 169the area of the rectangle is 196the area of the rectangle is 225the area of the rectangle is 256the area of the rectangle is 289the area of the rectangle is 324the area of the rectangle is 361the area of the rectangle is 400the area of the rectangle is 441the area of the rectangle is 484the area of the rectangle is 529the area of the rectangle is 576the area of the rectangle is 625the area of the rectangle is 676the area of the rectangle is 729the area of the rectangle is 784the area of the rectangle is 841the area of the rectangle is 900the area of the rectangle is 961the area of the rectangle is 1024You can't have a rectangle whose area is greater than a square meter

preferences:
242.44 ms | 408 KiB | 326 Q