Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
PHPのスカラー型をクラスでラップして便利に使えるようにするライブラリ「Stannum」を作った話
Search
tumugin.myskng
April 11, 2022
1.7k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
PHPのスカラー型をクラスでラップして便利に使えるようにするライブラリ「Stannum」を作った話
tumugin.myskng
April 11, 2022
Featured
See All Featured
Product Roadmaps are Hard
iamctodd
55
13k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.6k
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
240
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
1.3k
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
850
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
56
3.5k
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
540
Technical Leadership for Architectural Decision Making
baasie
3
570
How GitHub (no longer) Works
holman
316
150k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.3k
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
240
Claude Code のすすめ
schroneko
67
230k
Transcript
Copyright© M&A PHP Stannum PHPerKaigi 2 0 2 2
Copyright© M&A 2 M&A Twitter: @myskng (Twitter ... ...) GitHub:
@tumugin PHP(Laravel) JavaScript TypeScript(Vue) ( Ruby Kotlin ...)
Copyright© M&A 3
Copyright© M&A 4
Copyright© M&A 5 ) , , , , , ,,
,,, ... string string
Copyright© M&A 6 ( ...) ( UI )
Copyright© M&A Ruby 7 ....? ' , , , ,
, ,, ,,,' .split(',') .filter { |s| !s.strip.empty? } .map { |s| s.strip } .uniq => [" ", " ", " ", " "] PHP ....( )
Copyright© M&A PHP 8 PHP ... $inputTags = ' ,
, , , , ,, ,,,'; $splitTags = explode(',', $inputTags); $splitTagsWithoutEmpty = []; foreach ($splitTags as $tag) { if (trim($tag) !== '') { $splitTagsWithoutEmpty[] = trim($tag); } } $splitTagsWithoutEmptyAndDuplicate = array_unique($splitTagsWithoutEmpty); ...? ....?
Copyright© M&A PHP 9 array_unique( array_map( fn(string $s) => trim($s),
array_filter( explode(',', ' , , , , , ,,, ,,'), fn(string $s) => trim($s) !== '' ) ) ); ...😇 😇 😇
Copyright© M&A 10 🥺🥺🥺
Copyright© M&A 11
Copyright© M&A 12
Copyright© M&A 13
Copyright© M&A 14 extension (nikic/scalar_objects) - ... - PHP
Copyright© M&A 15 RFCs PHP RFC: Autoboxing https://wiki.php.net/rfc/autoboxing PHP RFC:
Class-like Primitive Types https://wiki.php.net/rfc/class-like_primitive_types ...
Copyright© M&A 16 ...🥺🥺
Copyright© M&A 17 ...
Copyright© M&A 18 💡💡💡💡
Copyright© M&A 19
Copyright© M&A 20 ... tumugin/stannum PHP 7 . 4 (
array) float/double integer string Sn => Stannum( )
Copyright© M&A 21 SnString::byString(' , , , , , ,,
,,,') ->split(',') ->filter(fn(SnString $s) => !$s->trim()->isEmpty()) ->map(fn(SnString $s) => $s->trim()) ->distinct() ->toSnStringList() ->toStringArray(); ... PHP
Copyright© M&A 22 PHP ...?
Copyright© M&A ... foreach ...? 23 $sushiList = SnStringList::byStringArray([ '
', ' ', ' ', ' ', ' ', ]); foreach ($sushiList as $sushi) { // something... }
Copyright© M&A __toString() ...? 24 $wantToEatSushi = SnString::byString( ' '
); return "{$wantToEatSushi} "; =>
Copyright© M&A 25
Copyright© M&A 26 composer require tumugin/stannum