Skip to content

Instantly share code, notes, and snippets.

View GilbertrdzDev's full-sized avatar
:octocat:
Limitless!

Gilbert Rodríguez GilbertrdzDev

:octocat:
Limitless!
View GitHub Profile
<?php
function memoize($target) {
static $memo = new WeakMap;
return new class ($target, $memo) {
function __construct(
protected $target,
protected &$memo,
) {}
#!/usr/bin/php-zts
<?php
# By: https://github.com/zheltikov
# Used in: https://www.youtube.com/watch?v=L_FdpmJatdw
# Define a custom Thread class
class MyThread extends Thread {
private $name = "";
private $duration = 0;