Skip to content

Instantly share code, notes, and snippets.

View cuppyzh's full-sized avatar
🎯
Focusing

cuppyzh

🎯
Focusing
View GitHub Profile
@cuppyzh
cuppyzh / pipeline.php
Created January 22, 2019 17:43
JDS PHP#2
<?php
class Pipeline
{
public static function make_pipeline(...$funcs)
{
$args = func_get_args();
return function($arg) use ($args)
{
foreach($args as $function) {
@cuppyzh
cuppyzh / palindrom.php
Created January 22, 2019 17:28
JDS PHP#1
<?php
class Palindrome
{
public static function isPalindrome($word)
{
$word = strtolower($word);
$newWord = "";
for ($i = strlen($word)-1; $i >= 0; $i--){
$newWord = $newWord . $word[$i];