u/justaphpguy
In this archive from Jan 2015 to Oct 2026
- 15
- posts
- 1.3k
- comments
- 1
- media
- 3.4k
- score
Top posts
[RFC] Treat namespaced names as single token
PHP currently treats namespaced names like Foo\Bar as a sequence of identifiers and namespace separator tokens. This RFC proposes to treat namespaced names as a single token, and as such allow reserved keywords to appear inside them. At the same time, it proposes to lift reserved keyword restriction...
State of PHP based parser generators?
I searched the webz a bit and found these (in chronological reverse order of last update): https://github.com/ircmaxell/PHP-Yacc (2017, 2months ago) https://github.com/hafriedlander/php-peg (2014) https://sourceforge.net/projects/lime-php/ (2013) https://github.com/wez/lemon-php (2012) https://githu...
State of resque for PHP
I'm trying to figure out what the state/ecosystem of php-resque at the moment is. I've a complex system running using https://github.com/wa0x6e/Cake-Resque which is based on https://github.com/wa0x6e/php-resque-ex but some behaviour are not the same with php-resque ; also something don't play well n...
PHP appserver.io 1.0.0 released
URL: https://github.com/appserver-io/appserver They released 1.0.0 a few days ago. I only found one mention here from a year ago. http://www.reddit.com/r/PHP/comments/1m5u5i/php_application_server_based_on_pthreads/ I wonder who is really using this, in production. How it compares to ReactPHP and ho...
I call this the work of a crazy genius.
Whilst it may come naturally to many developers, I don't consider implementing the GraphQL spec trivial, so kudos to pulling it off.
But: no composer, no test, using the exact same namespace as the basically de-factory primordial PHP implementation https://github.com/webonyx/graphql-php/ , files which aren't even classes, heck I've no idea what this is supposed to be https://github.com/joonlabs/php-graphql/blob/master/src/Introspection/Introspection.php
Unless this thing receives a major overhaul (at which point I question what's the point aka benchmarks vs. the existing one), this is surely dead on arrival.
But I guess you gotta passion, so I conclude with: never rest!
Awesome. On paper.
Personally, I would never ever add this complexity to my CI/CD pipeline, this would be ridiculous. Time is better spent preparing the upgrade to PHP8 and if you can't right now, well, then just wait.
All this additional potential risks are absolutely not worth the trouble for any serious business.
๐ฟ
strtokNot necessarily for full blown tokenization but it's the quickest way I know to get "a string until a given character or the full string".
Like you've a link and want all until the query part even if there's none:
strtok($link, '?')For the easy cases, no parse_url needed, no regex, no strpos/substr, no Uri class.
Early return from functions instead of nesting and a single return at the end