Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Denny all or allowed what you need

Featured Replies

Im practicing my function paramter arguments input for example

<?php

function expire($day = 0)
{
	if (!is_int($day)) {
		throw new Exeption('Error here.');
	}
	
	return (60 * 60 * 24 * $day);
}

Or should i use

<?php

function expire($day = 0)
{
	if (!isset($day) || empty($day) || is_null($day) || is_array($day) || is_bool($day)) {
		throw new Exception('Error here.');
	}
	
	return (60 * 60 * 24 * $day);
}

Which is better?

  • 1 month later...

Is this a trick question? :).

 

The first one with Exception spelt correctly as you are doing unnecessary checks in the second.

  • $day is always set so you don't need isset
  • is_int makes checking is_array, is_bool, is_null and empty redundant
  • The first one is easier to read and maintain

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.