GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sons of PHP
  • Source Code
  • 📦Components

This view

  • Original page
  • New address

GeezerVison is showing docs.sonsofphp.com — Assert | Sons of PHP

For the complete documentation index, see llms.txt. This page is also available as Markdown.

Installation

composer require sonsofphp/assert

Usage

<?php

use SonsOfPHP\Component\Assert\Assert;
use SonsOfPHP\Component\Assert\InvalidArgumentException;

$data = 'test';
Assert::string($data);

// @throws InvalidArgumentException
Assert::int($data);

// Disable exceptions
Assert::disable();

// @return bool
Assert::int($data);

// Re-enable exceptions
Assert::enable();

Assertions

Magic Assertions

PreviousState Machine
NextCache

Last updated 2 years ago

You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.