PHPackages                             fredlawl/sinsql - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. fredlawl/sinsql

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

fredlawl/sinsql
===============

A small little language interpreter written in PHP to parse and execute user-defined logic.

v1.1.2(9y ago)120MITPHPPHP ^5.5 || ^7.0

Since Jan 7Pushed 8y agoCompare

[ Source](https://github.com/fredlawl/sinsql)[ Packagist](https://packagist.org/packages/fredlawl/sinsql)[ Docs](https://github.com/fredlawl/sinsql)[ RSS](/packages/fredlawl-sinsql/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (3)Versions (5)Used By (0)

SINSQL (SINSQL is not SQL)
==========================

[](#sinsql-sinsql-is-not-sql)

A small little language interpreter written in PHP to parse and execute user-defined logic.

This pet project was inspired by a past project where a grammar similar to this was needed to conditionally render content on site based on certain user-defined criteria.

Install
-------

[](#install)

**Requirements:**

- PHP5.5+

You'll need [Composer](https://getcomposer.org/doc/00-intro.md) then run:

`composer require fredlawl/sinsql`

Require the autoload file into the files that will use SINSQL:

`require_once('vendor/autoload.php');`

Examples
--------

[](#examples)

> Results will always be false unless proven true.

### Language Grammar

[](#language-grammar)

```
"text" IS "TEXT"
=> true

```

```
"Chiefs" IN ["L.A. Rams", "St. Louis Rams", "Rams"]
 => false

```

```
(25 GREATER THAN OR IS 21) OR (1991 LESS THAN OR IS 1995)
 => true

```

```
(:isAwesome IS "true") OR ((:age GREATER THAN OR IS 21) AND (:footballteam IN ["L.A. Rams", "St. Louis Rams", "Rams"]))
=> true

```

### PHP

[](#php)

```
