3v4l.org

run code in 300+ PHP versions simultaneously
<?php $fileSize = new fileSize(); $minHeight = 180; $minWidth = 180; $shortestSide = 180; if ($fileSize->getWidth() > $fileSize->getHeight()) { if ($fileSize->getHeight() > $minHeight) { $width = round($fileSize->getWidth() * ($minHeight / $fileSize->getHeight())); $height = $shortestSide; } } elseif ($fileSize->getHeight() > $fileSize->getWidth()) { $height = round($fileSize->getHeight() * ($minWidth / $fileSize->getWidth())); $width = $shortestSide; } elseif ($height === $width) { $height = $minHeight; $width = $minWidth; } return ['width' => $width, 'height' => $height]; class fileSize { public function getWidth() { return 1200; } public function getHeight() { return 630; } }
Output for git.master, git.master_jit, rfc.property-hooks

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:
57.14 ms | 401 KiB | 8 Q