« first day (1654 days earlier)      last day (3297 days later) » 

5:00 PM
7 mins ago, by Danack
@samaYo why would you want to do that?
 
@marcio nop
 
Anonymous
@Danack It doesn't matter. We all use PHP for our own purposes and our own ways.
 
@samaYo do you really want to have dynamic variable variables? :D
 
@samaYo eih… no. :o
 
And suddenly I am afraid of php7... 3v4l.org/6WcvG
 
5:02 PM
@NikiC I don't like this 'ability' to overwrite the subject with a temp var, but not really an issue
 
hey @ElizabethMSmith
 
Hello
I hate hate hate naming things
 
Anonymous
@bwoebi so, it's a no?
 
@samaYo exactly
 
@samaYo Yes, because there's absolutely no possible way that the problem you're trying to solve could be solved in a better way than trying to get the name of variables passed into a function.
 
5:04 PM
@ElizabethMSmith Call it yy
 
Or John. John is a nice name.
 
@ElizabethMSmith The hardest things in programming aren't logic but naming and descriptions…
 
@samaYo I'm not very curious to know why you want to know the name of the variable but... why?
 
I doubt a stream interface called yy would be useful
:)
 
@NikiC Whenever I see yy, I think about bison/yacc…
 
Anonymous
5:05 PM
@bwoebi it's would have been actually a very important thing to do
 
@samaYo Why do you love approaching problems the wrong way? :-)
 
Can anyone explain why static now works different in PHP7 ?
 
how different?
 
Anonymous
@marcio 99% of the people here use php for the same purpose, using the same principles, similar frameworks, design patterns etc... so, it's completely normal this idea may look/sound foreign to you, but for me, it has a very solid use-case
 
5:07 PM
@samaYo and that use case is...
 
Anonymous
@bwoebi wrong is in the eye of the beholder :)
 
@bwoebi obligatory cache invalidation, off by one
 
@NikiC off by one is fixable at least…
 
@chozilla "Output for 5.3.0 - 5.6.8, php7" - er, it's been the same for the past few years...
The different one is from a build last year - php7@20141201. It's probably not relevant.
 
Anonymous
@marcio never mind, just too said this would-be a kick ass concept does not exist in php :/
 
5:09 PM
> There are only two hard problems in computer science: cache invalidation, naming things, and off-by-one errors
 
Or am I reading them wrong?
 
@NikiC nah, there are four ;-)
 
@chozilla huuuuu
HHVM and PHP with the same output? Must be a bug.
 
@chozilla I guess it looks like a bug that was fixed?
 
my first PR to PHP-SRC: github.com/php/php-src/pull/1251 (everybody starts little)
\o/
 
5:13 PM
find some more typos… Search new PHP 7 comments from Dmitry…
 
"minor typo" - is "$arary" a minor typo too?
 
Anonymous
<- jealous @hakre
 
:-/
 
@hakre there are a couple of typos in the php.ini too iirc
 
Anonymous
@Worf let me know.
 
5:15 PM
@Ocramius then stop writing dirty code
 
@ircmaxell it's mapper code - a mapper is reflection-based
any routing system based on types is also reflection-based
 
my project manager today reminded me (again) that my comments in tickets are full of typos. so I'm probably not the best to go through php.ini ^^
 
ummmm
 
(package routing)
 
derp
 
Anonymous
5:16 PM
I made my first contribution to the php manual here
 
le sport du ping pong
 
@samaYo yay! Nice job!
 
having $foo::class already reduces overhead by allowing us to simplify any calls to $reflectorCaches[$foo::class], for example
(one method call less)
 
@Ocramius remember what @NikiC said about us making no guarantees about code you write working? Well that extends to performing fast as well :-P
 
Anonymous
@ircmaxell Thanks. Next target is to learn C, and contribute to the php-src.
 
5:17 PM
This is ancient code that has been around since 2.0.x-alpha of the ORM, as well as in many other related projects
 
@chozilla this new behavior seems right to me
 
and this is stuff that still bites us even on new code too :P
 
@samaYo This reminds me that I still wish I made functions that return by reference to put the & next to the return type :/
Everyone else I talked to seemed to be against it, so I didn't bother.
 
@LeviMorrison in a new language design, I would be with you 100%. But considering the baggage here...
 
@marcio so static $a is no longer a pointer to a value but becomes a none static value?
 
Anonymous
5:20 PM
@LeviMorrison I haven't even thought about using that. I don't have much love for references for some reason. They scare me :/
 
@ircmaxell Hey, if you are updating the code to declare a return type then you can move the & :)
 
@LeviMorrison :-P
 
When designing a new language I would get several things right thanks to PHP getting them wrong.
 
@chozilla $a is still static (the value persists between calls) it's just no longer passed as ref
 
Identifiers would be case sensitive.
Properties, methods and constants would all share the same table.
 
5:22 PM
@marcio is that intended?
 
Traits would not just be copy and paste.
 
@chozilla I don't think so; cc @NikiC
 
@marcio context?
 
17 mins ago, by chozilla
@marcio http://3v4l.org/6WcvG
sorry, reference context was lost after multiple messages.
 
@Danack I guess using object interface (instead of array) would be the best option
 
5:24 PM
@marcio I'll look later, dinner
 
^^ np
 
@marcio looks like a deref issue…
 
the culprit for me is that it seems better this way
 
?!
 
user895378
@Danack are you still interested in a composer alternative?
 
user895378
5:30 PM
Because Bob and I are looking at composer trying to work in async IO and the whole thing is written in such a way that it will be very difficult.
 
user895378
Building on my existing tools I could implement something like that and it would be several orders of magnitude faster than what composer does right now ...
 
@rdlowrey Possibly interested but the ecosystem is probably harder than the code....and I don't think any of us have time to manage that.
I need to finish off github.com/danack/GithubArtaxService and then could make Composer use that. warning that code may currently burn your eyes to look at.
 
user895378
The problem I have currently is that everything composer does is synchronous. I can't retrieve resources concurrently because things like progress updates are stored in the same place (would corrupt the data).
 
user895378
I mean ... composer could be wayyyyyyyyyyyyyyyy faster if it were implemented to take advantage of amp/artax/etc.
 
And everything is run by the symfony/console - which is a bunch of shit....
 
user895378
5:34 PM
That too.
 
^ that was my reaction when I tried to mess with composer
 
user895378
"Sure, let's stop all concurrent retrieval so we can wait for command input"
 
I'm with you at that last point I don't like it as well. But I still didin't upgrade my devbox :/
 
To be honest - it's not that a big problem for me, and if it was the solution wouldn't be to rewrite Composer - it's to use your own Satis repository only, instead of using Packagist. That speeds everything up massively.
For local updates when doing dev, everything is cached locally. When doing deploys to a server, the satis machine is 2 milliseconds away, so it has decent speed even with crap code.
 
@bwoebi I don't see this by reference behavior defined on the specs github.com/php/php-langspec/blob/master/spec/… (not joking)
 
5:45 PM
@marcio To clarify: PHP 7's behavior is correct in your opinion, yes?
 
yes, I actually never noticed that static variables were implicitly passed by reference on earlier versions until now
 
I have never seen that as well. I knew that static variable are global (e.g. shared across functions on different instances) but never knew they were that sticky.
 
If there are several seminars, some of them happen a particular week, some of them happen every week... how would I find seminars for which records doesn't exist in the maintenance table?
 
@marcio the new behavior looks correct
 
so it was intended bug fix + BC break, right?
 
5:48 PM
[]= shouldn't be retaining a reference. I don't get why it did what it did in php 5
 
@user3692125 I'm not sure of your exact problem - but I'm guessing an outer join will be involved - blog.codinghorror.com/a-visual-explanation-of-sql-joins
 
@Danack ... so if I have table "seminar" that lists seminar_id and whether they occur every week or every other week etc... which table would I join it to? My problem/question is... I want to come up with dates for which record should have been there in maintenance table but for some error/reason, it's not there...
so I need to find all such dates
 
@NikiC so it is about the array syntax and not about the static keyword that marked $a as a pointer rather than as the value it had?
 
@chozilla It's most likely a bug in the old ArrayObject implmentation. If you do the same thing with normal arrays it certainly doesn't happen
 
@user3692125 something like select seminar_id from seminar s outer join maintenance m on s.seminar_id = m.seminar_id will give all of the entries in seminar that aren't listed in maintenance. There may be more details needed with the weekly stuff....
 
5:54 PM
@NikiC thank you that helped.
now the question is, how to get a pointer to $a in there...
 
@Danack if a seminar was supposed to happen every week on Tuesday, and there are no records for it for April 28, 2015... I want to return April 28, 2015 ... maintenance table will have records for all the Tuesdays for that tuesday, if for some reason, it does not, I want to return that particular date(s)
 
@chozilla apparently no easy way 3v4l.org/4DHGn
 
@user3692125 That sounds more difficult, and something that would be better done in just PHP code rather than trying to do it in SQL.
 
Any pointers?
 
Not really - I'd question the sanity of your schema though. Having to enforce data integrity like that sucks. It would make more sense to change whatever function is getting the 'maintenance' records to be aware of repeating seminars, and can calculate whether it's going to be on that day. That way the data is just stored in one place, rather than replicated.
 
5:59 PM
@chozilla How about just not?
 
PHP7 evil goals:

[✓] punish people declaring `class String|Bool|Null|...`
[✓] punish people abusing json_decode() with invalid input, according to json specs
[✓] punish people (ab)using surprise references
 
it's not for data integrity
 
might be a repost, but i had to share:
 
@marcio tl;dr PHP 7 is the punisher
 
I got punished twice already ^^
 
6:06 PM
@marcio Those are righteous goals, not evil ones.
:)
 
Anonymous
 
@LeviMorrison evil in a good way
 
@LeviMorrison I just got the context. This is actually a different, an even more annoying pattern. What he's actually saying is "I want to be able to upgrade to a new version of PHP, to get the new features, but I don't want any of the downsides.", which is annoying. People are free to choose to upgrade or not, but they don't get to complain about small BC breaks.
 
@samaYo Try [tag:cv-pls] and then put your link afterwards
 
Well, they are only free to not upgrade for roughly 3-5 years if they want security patches.
 
6:12 PM
What do we need to introduce to php to FORCE wordpress to rewrite the complete codebase? :D
 
Anonymous
@Machavity I haven't 'ed in a long time, I actually forgot how to do it.
 
Anonymous
@MarcelBurkhard and Drupal.
 
(not serious)
@samaYo you checked out drupal 8 beta? It is a complete rewrite, they even use composer IIRC
 
Anonymous
@MarcelBurkhard Nah, I didn't know 8 was out, I am using 7 now.
 
Anonymous
I will update.
 
6:14 PM
its not out its a beta
not safe for production
 
@MarcelBurkhard That implies there's some safe version out there to use :P
 
unintentional
 
Anonymous
> 39 critical issues remaining
 
6:15 PM
@samaYo I know, I verified its still beta before I wrote
^^
 
Anonymous
@MarcelBurkhard Where did you find 8? I can't see a download link.
 
Anonymous
Did you get it from github?
 
I wonder how much work it would be to allow traits to formally implement interfaces.
 
Anonymous
thanks ^
 
6:20 PM
@samaYo md5: 104a3a8bf513fbd375ae0b0fa3aeeb6c
(just in case you care)
 
Anonymous
I will just keep playing around with it, until all the issues are resolved.
 
user895378
What's the status on anonymous classes? Is that in master yet?
 
Anonymous
Is it possible to dump mysql data file into postgres?
 
@rdlowrey yes, landed today
 
user895378
@NikiC thanks for subsidizing my laziness so I didn't have to go look for myself :)
 
6:27 PM
Yay for anonymous classes!
 
\o/ indeed
@NikiC Does it come with a nice internals API? ;)
 
I'm working on like, 37 things that could benefit from them right now
 
@LeviMorrison no ... ?
 
Nothing ever does, amirite?
 
@DanLugg everything is simple, you just gotta start running php 7 in production
 
6:29 PM
Very much looking forward to it
Although, I'm looking forward to 5.3 at the moment cause I'm stuck on 5.2 for some legacy bullshit
 
@NikiC So anonymous names use file + line and position?
Or something like that?
 
@LeviMorrison They use class@anonymous
And a bunch of other stuff after a NUL byte, which you will usually not see
 
@LeviMorrison file and pointer into the lexer buffer
 
... [noticed that we're using sizeof() without a -1]
 
user895378
6:40 PM
Seriously ... all of my new userland development is targeting php7 as a minimum requirement.
 
@rdlowrey I think Wordpress 5.0 is vowing to support PHP 8
 
Psh, all of mine requires 7.1 you filthy casuals.
 
user895378
dev-master ftw
 
Union, intersection and enumerated types for the win!
 
user895378
How's that development going?
 
6:41 PM
Well, but I shouldn't be doing it at all until I hear back from the Undergraduate Committee.
lol
 
@LeviMorrison oh, not yet requiring PHP 9? (You know, there won't be PHP 8^^)
 
user895378
I'm sure the fine faculty of BYU can be swindled persuaded into granting you credit ;)
 
I need to work on something else, so I was thinking about features I've wanted in the past.
 
@LeviMorrison in what context?
 
I thought of one worth investigating: allowing traits to declare that they implement an interface.
(or more than one; whatever)
 
user895378
6:44 PM
Congratulations to @bwoebi for finding the Best Class Evah
4
 
lol
 
@rdlowrey That's some fine work coming out of the League. /cc @PhilSturgeon
 
user895378
Such Java. So OOP. Much class. Wow.
 
user895378
I'm sure it's useful in some context ... just not my particular cup 'O tea.
 
@rdlowrey Reminds me of the Password Encryption Class (just shorter)
 
user895378
6:47 PM
And it actually does extend something else so there's real behavior going on there. It's just funny to see a class for that.
 
user895378
That climate library is pretty nifty though.
 
user895378
I peed my pants when I saw it could do animation.
 
Seriously… I have no idea what this library is doing behind the scenes. It's that obfuscated that I have no idea after 15 mins where the ANSI escape sequences are finally tied together.
> User input can't be trusted, substitute the password
Oh, yeah
 
very useful, thank god they did it github.com/thephpleague/climate/blob/…
 
6:54 PM
@LeviMorrison lol. That's an awesome default path
 
$secure looks fishy too.
 
@LeviMorrison what's wrong here?
 
@bwoebi string|null with a default of '/'?
 
That's just default setcookie() params
@LeviMorrison null is probably use system default
 
Anonymous
static function __callStatic($func, $arg){
	$select = $insert = $update = $delete = null;
	$$func = true;

	if($select){
		//
	}
	if($insert){
		//
	}
	...
}
 
Anonymous
7:02 PM
How bad is that ^^
 
@samaYo very
On a badness scale of 1 to 10, that is an 8
 
just..... why????
 
You're essentially just using variable variables there to use them somehow, even if that way doesn't make absolutely any sense
 
@samaYo use a switch… or just simple methods
 
Anonymous
7:05 PM
I just liked how the variables described what the block of code does. :/
 
PHP8 wish list:

[ ] punish people using variable variables
[ ] punish people using variable variable variables even more
[ ] punish ppl using variable variable variable variables too
 
BY THE WAY
Does PHP support $$$var?
That would be so awesome
$x = 'y'; $y = 'x'; echo $$$x;
 
It does…
 
$$$x::class
 
I don't consider it particularly awesome
 
7:10 PM
@MarcelBurkhard amateur
 
Anonymous
PHP7 Idea.
 
Anonymous
use foo\bar as $bar;
$bar->foo();
 
@samaYo ?
 
Anonymous
@MarcelBurkhard keeping.it.simple.
 
Anonymous
use foo\bar as bar;
$bar = new bar;
$bar->foo():
 
7:13 PM
WHAT is the airspeed velocity of an unladen swallow?
 
@samaYo so you want an autoconstructor or what?
 
posted on April 27, 2015 by rdlowrey

This is the final amp release for PHP5.x. From this point this code will only receive bugfix micro releases. New development will take place requiring PHP7 in the master branch.

 
@bwoebi whoa it really does
obfuscators should abuse this feature, it's awfsome
 
@nikita2206 one of the guys that made the code I need to maintain used it :(
 
@MarcelBurkhard obfuscator or $$$? I don't really mind using $$$, $$$ is life
 
7:16 PM
variable variables
 
@Feeds yay
 
@Feeds @rdlowrey PHP 7 only now \o/
 
user895378
yeah I'm pretty excited about that.
 
user895378
I suspect many of the stragglers stuck on 5.2/5.3 will attempt to make the jump straight to 7 once it comes out.
 
@rdlowrey the client doesn't care, until the host drops support for 5.3
in most cases
 
@rdlowrey Ah shoot, and I am just barely getting PHP 5.6 on Debian Jessie at work.
 
user895378
:(
 
user895378
good thing php is super easy to build yourself :)
 
Will there be a stable-ish Artax release that will work on PHP 5.6?
If not we'll just stay on our super-outdated commit :)
(Hey, it's been working fine so far!)
 
user895378
@LeviMorrison yes. I'm working on those things this week
 
user895378
7:28 PM
Trying to get all that related stuff into final 5.x-support branches so I can make all master branch dev require PHP7
 
I am excited for 7.0, yes, but I think 7.1 has the potential to be even better.
With scalar and return types landing in 7.0 that allows for a lot more type features to land in 7.X
 
user1648409
How to select all values in column x of table a while not counting all values of column x in table b with SQL?
 
@ircmaxell That was quick
 
For instance, void or null return types would be one nice little improvement. Union, intersection and enumerated types would all be nice, and possibly function signatures as types too!
 
posted on April 27, 2015 by rdlowrey

This is the final PHP5-compatible minor release. Only bugfix micro versions will follow in the v0.5 branch. New development will require PHP7 and take place in the master branch.

 
7:32 PM
conflicts: 1505 shift/reduce, 2 reduce/reduce

… Mhm… I must have done something wrong ^^
 
what are you doing? :)
 
@LeviMorrison I'm looking forward to it all
 
user895378
function signature types would be really nice, but yeah, it all sounds good :)
 
yeah, callable typing
 
I intend to have the function prototypes draft soon, there is some tricky details though
 
7:36 PM
type Iterable = array | \Traversable;

type FilterFunction = callable($value): bool;

function filter(Iterable $input, FilterFunction $filter): \Traversable {
    for ($input as $value) {
        if ($filter($value)) {
            yield $value;
        }
    }
}
 
:)
 
@marcio Such as? I don't have a proof of concept but I've played around with some internal data structures for it.
 
I'm in doubt about variadics behavior. And also when the function prototype doesn't specify a return type but the given callable specifies one.
 
Does comparing the above FilterFunction with something like function f(Object $a, Object $b): bool; check out?
I'd have to think about the return types one a bit more.
 
it get's kinda worst if you consider internal functions supplied as callbacks :/
 
7:41 PM
Fortunately I find most internal functions unsuitable as callbacks because they never behave quite how I want them to.
 
@marcio that's variance, so I would think that's ok
 
@LeviMorrison it's impossible to check their return types anyway most return mixed, to allow internal functions the requirements for function prototypes will have to be very lax
 
@LeviMorrison I think it depends on mode. In strict mode, it should fail due to the traversabe -> bool conversion. In weak, should go through fine
 
@ircmaxell I don't think you understood; just a second I'll show code.
 
I may not
 
7:45 PM
Oops, wrong f copied :)
That would also explain the confusion above :)
 
/me lazily waits for behat to finish doing whatever it is doing with this stupid infinite multi-step form...
 
so is callable($value): bool satisfyable with f(Object $a, Object $b): bool ???
 
function f(Object $o): bool {
    return !empty($a->property);
}

filter([1,2,3], 'f');
 
@ircmaxell no
 
Would passing (Object): bool be fine for a (mixed): bool declaration?
 
7:47 PM
part of me wants to say yes, and part of me no...
 
if the prototype function has n required arguments the given callable can't have more than n required arguments
 
@ircmaxell I think there is an answer based on known types research; I just have to think about it long enough :)
 
actually, I think it should behave just like interfaces
if we allow variance in one, we do in the other
allowing variance in one corner is not good
 
do you agree that f(Object $a, Object $b = null): bool satisfies callable($value): bool?
 
no
 
7:51 PM
k, just to clarify... you think that the callback can have a return type non specified by the prototype but the arg list of the callback can't?
function($n) : int {} satisfies callable fn($n){}
but...
function(int $n) {} does not satisfies callable fn($n){}
?
 
@ircmaxell There is a difference between inheritance compatibility and parameter compatibility at runtime.
 
I need some naming help: When there is a class method or object method, what is a term for both the class and object in relation to the method?
 
interface A {
    function __invoke(Traversable $t);
}
interface B extends A {
    function __invoke(Iterator $t); // not okay
}
// but you can pass an Iterator to A::__invoke;
@hakre I have heard it called the context before.
Sometimes called scope as well.
 
@LeviMorrison context came also to my mind. It's just that I'm really a noob when it comes to CS terms.
execution context that is perhaps, but I would prefer it a bit more static and less moving.
 
8:07 PM
Hi everybody, I was wondering is it dangerous for logging purpose to print_r($_REQUEST, true) or is it safe enough ?
If there's a direct access to a certain file within my webapp i'm loggin to a file the ip address with the request sent then i display 404 Not Found to be sure bot don't try to many time does that look safe enough ?
 
print_r with superglobals that are injected is not save.
it's maybe ok for temporary debugging purposes, but if you tend to leave it in, you might wake up one day with cold sweat in your bed.
@samaYo nice one.
 
8:23 PM
It should be okay if it's just being written to a text file...
Though whether that's going to be of any actual use is arguable. It seems it would be a better thing to just do at the web server level.
 
8:46 PM
@ircmaxell Bleh, I am having trouble finding helpful resources. The only resources I can find are in languages that have user-defined variance (such as Scala with +T and -T).
 
@Danack a webserver level ?
 
@JonathanLafleur $_REQUEST is probably not hugely useful anyway. I'd suggest you want to log the IP, request method, then create a custom routine to dump $_GET and $_POST separately, where you can e.g. use strlen() to truncate large fields. But a better solution might exist if you explain why you need to do this...
 
it's written to a txt file
@DaveRandom the file is only suposed to be accessed by ajax inside the Wordpress ecosystem, if you request it directly you're out of the ecosystem, and it should log who have tried it and why
 
@marcio The compile_class_decl issue is already fixed locally
will be up with the next push
 
user1648409
Hi, how can it be that when i run the same query on my php Script it gives me back true and when running it in phpmyadmin it gives me back the actual result that i want (2rows)?
 
8:53 PM
@Shiuyin with the actual code it could be easier to help you ;)
 
user1648409
SELECT tabletID
FROM Tablets
WHERE NOT EXISTS
(SELECT *
FROM Worklist
WHERE Tablets.tabletID = Worklist.tabletID)
 
That's the SQL request, and the php around it ?
 
user1648409
@JonathanLafleur I just execute this with my $mysqli->query() instance and get back a true instead of the 2 rows that actually should be returned
 
@Shiuyin woah
 
user1648409
@Leri woah? :D
 
8:56 PM
@Shiuyin then either you have found a bug, or you did not read the documentation ;-)
 
user1648409
fast googling the mysqli query doc
 
@Shiuyin select tabletID from from tablets join worklist on (tablets.tabletId <> worklist.tabletId) :-)
 
user1648409
@Leri no difference, still gives me back true :D
 
Well, use your real names. ^^
 
user1648409
@Leri already changed that
 
9:00 PM
@Shiuyin huh, that's the same that you have wrote but faster version
 
user1648409
@Patrick "Returns FALSE on failure. For successful SELECT, SHOW, DESCRIBE or EXPLAIN queries mysqli_query() will return a mysqli_result object. For other successful queries mysqli_query() will return TRUE." I am executing a select. So it should return an object, yet it returns a boolean
 
user1648409
@Leri It still only returns a true / false instead of an object :D
 
@Shiuyin good. now you know you need to debug your query :)
btw from from in leri's query is probably wrong
 
user1648409
already fixed that :P
 
user1648409
nvm i got the error :D
 
user1648409
9:09 PM
thanks for yoru help
 
9:19 PM
@NikiC I cherry picked and PR the wrong commit xD, thanks
 
@marcio [ ] punish people using references even more
 
[ ] punish reference haters ...?
 
@bwoebi @NikiC FYI github.com/php/php-src/pull/1221#issuecomment-96528591 all the people that raised concerns during discussion phase ended up voting yes and no one objected on the ML along last week. So I guess it's up to you both to decide if it's ok to merge now?
s/all the people/all the people except nikic
 
@marcio I just wonder whether we really shouldn't just return false on ParseError when token_get_all fails and use no constant… I'm not happy with that constant usage
 
@LeviMorrison :) this is happening already, all the random segfaults
 
9:31 PM
@marcio ha.ha.
 
punish them even more
 
@bwoebi you mean to don't throw the exception with the error message?
 
@marcio I dislike a ParseException being thrown here … which is more appropriate for errors in code to be also executed
 
@bwoebi we already have a ParseException in some cases while using token_get_all (without the TOKEN_PARSE flag), it was fatal error before but nikic converted to exceptions.
 
@marcio Like invalid octals you mean? true…
well… then just drop the flag and always throw
 
9:37 PM
@bwoebi but that would be a BC break, hence why we added the second arg and made it opt in
 
@marcio It's also a BC break that we now throw an exception and no fatal in lexer…
 
@bwoebi true... but @NikiC warned about people tokenizing non PHP code or invalid PHP code
on purpose
 
@marcio then we already had that issue with lexer issues.
 
@bwoebi ok. Can you both try to reach a consensus on this? I'll update the PR accordingly.
 
9:54 PM
@marcio this will be changed to not throw once I get around to it
Somebody raised a very valid concern that throwing form token_get_all really sucks for things like syntax highlighting
 
agree
 
I thought throwing a ParseException would be good enough (because it's good enough for my usage ^^), but for other cases it is problematic
So I'll switch this to return an E_ERROR token (already used internally) instead
 
@NikiC good idea
 
It would be nice to make the suppressed ParseExceptions available somehow, so it's still possible to get the extra info about the error if you want it. But not sure how
 
@NikiC add it to the error token?
 
9:57 PM
@bwoebi hm... how precisely?
I feel it would be better to have this separate. So you don't have to scan all the tokens to collect error info
 
the string content of the token?
[array index 1]
 
@bwoebi The string content should still be the string content (for highlighting e.g.) ^^
 
@NikiC yes… but it's an extra token which has no real string content?
 
@bwoebi nope, it's currently emitted in place of the invalid token
 
@NikiC oh okay… then this doesn't work
 

« first day (1654 days earlier)      last day (3297 days later) »