Skip to content

Instantly share code, notes, and snippets.

theseer / nullable-test.php
Last active Oct 2, 2019
Is this working as expected?? (PHP 7.4 required)
View nullable-test.php
class foo {
private ?string $bar = null;
public function __construct(?string $val) {
$this->bar = $val;
View sample.php
<?php declare(strict_types = 1);
namespace test;
use DOMDocument;
use Templado\Engine\SimpleSnippet;
use Templado\Engine\SnippetListCollection;
use Templado\Engine\Templado;
require __DIR__ . '/vendor/autoload.php';
theseer /
Created Mar 24, 2019
What happend to the `If-Modified-Since` header?

If-Modified-Since, PHP CLI Server and Firefox


When sending the cache control header Cache-Control: no-cache, must-revalidate along with a Last-Modified timestamp, the browser is required to send along an If-Modified-Since header for the next request to the same URL.

The server then is entitled to return HTTP/1.1 304 Not modified in case the content didn't change and the stored copy may still be used.

Sample Code

theseer / download-redirect.php
Created Dec 18, 2015
Redirect to the first attached file of the latest release
View download-redirect.php
ini_set('display_errors', false);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, '<user>/<project>/releases');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_USERAGENT, '<project> release redirector');
$releasesRAW = curl_exec($ch);

Keybase proof

I hereby claim:

  • I am theseer on github.
  • I am theseer ( on keybase.
  • I have a public key whose fingerprint is BEEB 9AED 51C2 8445 FAB1 4222 8DDB 46C4 EA2E BCDC

To claim this, I am signing this object:

View xpointer res in manual
theseer@nyda ~/storage/php/phpdoc $ grep 'class.datetime' /tmp/dump-manual.xml
<phpdoc:classref xmlns:phpdoc="" xmlns="" xmlns:xlink="" xmlns:xi="" xml:id="class.datetime">
<xi:include xpointer="xmlns(db= xpointer(id('class.datetime')/db:refentry/db:refsect1[@role='description']/descendant::db:destructorsynopsis[not(@role='procedural')])">
<xi:include xpointer="xmlns(db= xpointer(id('class.datetimeinterface')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[@role='oop'])"/>
<phpdoc:classref xmlns:phpdoc="" xmlns="" xmlns:xlink="" xmlns:xi="" xml:id="class.datetimezone">
<xi:include xpointer="xmlns(db= xpointer(id('class.datetimezone')/db:refentry/db:refsect1