Lightweight text indexer for PHP
Uses the dba extension (with db4)
Hello my name is Arnold and I'm not crazy. Arnold's kids are crazy though.
<?php | |
$distance = new Meter(3); | |
$cm = $distance->in(Centimeter::class); | |
ecoh $distance; // 3m | |
echo $cm; // 300cm | |
$distance == Decimeter(30); // True | |
$distance === Decimeter(30); // False |
<?php | |
use Jasny\DB\Option\Functions as opts; | |
use Jasny\HttpAttributes\Request\Accept; | |
use Jasny\HttpAttributes\Request\ParsedBody; | |
use Jasny\HttpAttributes\Request\PathParam; | |
use Jasny\HttpAttributes\Response\ContentType; | |
use Jasny\HttpAttributes\Route\Delete; | |
use Jasny\HttpAttributes\Route\Get; | |
use Jasny\HttpAttributes\Route\Post; |
<?php | |
$one = [ | |
'arithmetic' => ['+$a', '-$a'], | |
'bitwise' => ['~$a'], | |
'incdec' => ['++$a', '--$a'], | |
'logical' => ['!$a'], | |
]; | |
$two = [ |
<?php | |
/** | |
* `a > b > c > a` should always result in false. | |
*/ | |
function all_greater($a, $b, $c) | |
{ | |
return ($a > $b) && ($b > $c) && ($c > $a); | |
} | |
// Fails due to type juggling. |
/** | |
* Use em or rem font-size in Bootstrap 3 | |
*/ | |
@font-size-root: 14px; | |
@font-unit: 0rem; // Pick em or rem here | |
// Convert all variables to em |
<?php | |
declare(strict_types=1); | |
use Jasny\Auth; | |
use Jasny\Auth\Confirmation\InvalidTokenException; | |
use Jasny\Persist\Gateway; | |
use Jasny\Session; | |
use Psr\Http\Message\ResponseInterface as Response; |
<?php | |
/** | |
* Set the properties (including protected and private) of an object. | |
* This should only be called by the object itself. | |
*/ | |
function object_init(object $object, array $values): void | |
{ | |
$init = function ($values) { | |
foreach ($values as $prop => $value) { |
<?php | |
/** | |
* Render and send e-mail | |
*/ | |
class Email extends PHPMailer | |
{ | |
/** | |
* @var Twig_Environment | |
*/ |
<?php | |
var_dump("1" == 1); | |
var_dump("1" != 1); |