« first day (2699 days earlier)      last day (2475 days later) » 

00:05
nn
Good morning
Wes
Wes
00:38
@pmmaga 3v4l.org/1eEh2 you asked for traits bugs, right? :P
and yeah i'm not sleeping yet
If I call Loop::delay with a third argument, why does the callback receive that third argument as its second parameter? The first parameter is just set to the string 'z' for some reason
I guess that's some kind of cancellation token but it doesn't seem very well documented
Wes
Wes
00:53
similarly @pmmaga 3v4l.org/55lCt
01:07
@Wes php.net/traits#example-211 "The precedence order is that methods from the current class override Trait methods"
Wes
Wes
signatures must match. it's not renaming, it's aliases
read what I just wrote again
I'm not talking about aliases
Wes
Wes
ok, sorry i misread
still signatures must match
maybe this makes it more clear?
eventually the error is going to show up. a lot of checks are done at compile time but not all
this one is missing
but yeah the error already exists, but it's at call time
am i making sense? :B
there is no way to delete a method from a trait, you can only replace it with one with a matching signature or alias it into another name (means that both old and new name will be available)
but when you define the precedence or override it, the signature must match
exactly like it would with regular inheritance
01:25
posted on March 06, 2018

New Cyanide and Happiness Comic

Wes
Wes
we should get rid of these
@Wes No. The class method overrides the trait method even in the presence of an abstract method in the trait.
Wes
Wes
then the error is going to show up at call time :shrug:
i am 99.9999999% convinced that what i'm saying is correct. but i don't care about traits enough to continue having this conversation
i was just messing with php parser and noticed that they allow incompatible signatures
if it's a technical limitation, that i don't know
@Wes The earliest it could possibly show up is at the use-site, but it's not like we build a control-flow graph to determine if a trait method calls something wrong.
I think instead of traits we should have just had default method on interfaces...
Nearly all use-cases that I consider valid are to implement an interface...
Wes
Wes
you don't need control flow graph, as you cannot remove methods
you can only alias them
checks are active for any other trait usage except that one
01:51
@Wes No, not all trait methods will exist on the using class.
Wes
Wes
they will :P
unless you do use A, B{B::x insteadof A} and also in that case signature must match
No, they won't.
You don't seem to get it.
Wes
Wes
must = should
ok, i don't get them. again, i don't care
can i be for once arrogant and say that i think that it's you guys not getting them :B
@Wes You can propose changes to behavior if you want, I'm explaining that your descriptions don't match our actual behavior.
@pmmaga I don't alias.
Wes
Wes
i think they are just not implemented
but again i don't know if there is a technical limitation
in that case what can i do
02:05
The documented and intentional behavior is that the using class can completely override any method on the traits it uses.
Wes
Wes
why bother having type safety at all then?
anyway, forget about it. traits are great i love them :B
sorry for being sarcastic, i actually don't care
02:59
@Wes You seem to be missing one core idea about traits: they are a thing but they are also not a thing. They exist but then they don't.
The class is the unit that gets checked for conformance to parent types, not the traits it uses.
 
2 hours later…
04:38
which php function can convert < symbol to &lt;
not str replace ,any inbuilt php function
ok , htmlspecialchars works ... i was testing this code online , so it was showing rendered html
05:03
anyone knows symfony framework
i need help in that
i have created api and below is my sample code
public function idAction($id)
{

$result = $this->getDoctrine()->getRepository('AppBundle:Users')->find($id);


if (empty($result) )
{
$data = array(
'message'=>'User not found.'
);
return $this->returnJsonResponse(Response::HTTP_NOT_FOUND,false,array($data));

}


return $result;
}
this works fine but i get data in object
Hi all
I have 1 question
like there jsfiddle , sqlfiddle what is the site that will upload my image temporarily
?
and give me the path
got it
 
1 hour later…
06:18
morning ppl
\o
06:47
morning
07:01
moin
o/
Hi
Memory allocation issue in cake php while uploading a large image
07:16
user image
5
cake php ...
:-P
i will eat them all.
they were tasty ...
More like CupCakePHP
Does that 1 say pthreads?
yeah
wife got them for my birthday in 2014
:)
they look tasty indeed
07:28
Looks absolutely delicious :)
come on… it's php cakes. who are you fooling? They get the job done, but delicious? nah! and I am sure they are a mess inside
!!docs Componere.cast
[ Componere\cast ] Casting
!!docs Componere.cast_by_ref
[ Componere\Value ] A Value represents a PHP variable of all types, including undefined
07:30
!!docs Componere.cast-by-ref
[ Componere\Patch ] The Patch class allows the programmer to change the type of an instance at runtime without registering a new Definition
I don't know what I've done to break this ...
weird
I admire your effort on this Componere thing. However, to be really valuable, the language should support this natively. Being able to monkeypatch like this out of the box could open up a whole new dimension to php programming.
ok, it's also like opening up the gates of hell as well, but it might be worth it
I'm too tired to argue with internals about stuff ...
07:34
@QuolonelQuestions amphp.org/amp/event-loop/api#delay clearly documents it.
@JoeWatkins looks like the functions aren't indexed
I can't search for cast_by_ref on the manual either, I think I named something wrong in the docbook ...
@Gordon depends how well insulated you are
php.net/manual/en/book.apcu.php etc seem to use function.<name>.php
whereas that link is componere.cast_by_ref.php
maybe it's that
but cast is named the same way
07:45
indeed, weird
someone will squeak at me if I break links anyway, so it will remain broken ...
08:00
benighted intellectually or morally ignorant; unenlightened: benighted ages of barbarism and superstition.
benighted but happy
!!dad
What do you call a deer with no eyes? No idea
08:56
\o
o/
hello :)
09:11
Morning
one of them stupid questions that google won`t answer, but the answer seems obvious, yet I could use a confirmation from another human being within business... In general: If I change the DNS of the domain, will the subdomains dns move as well? (I guess it is a yes).
I think no
oh dear... not what I expectd :/
0
Q: Does a Name Server change on a domain also affect Name Servers of sub-domains of that domain?

navigatorWe've got a web application product whose home page is at, for example, abcd.com One of our clients is running the web application on a sub domain. E.g. customer.abcd.com Both domains are currently hosted with Arvixe and Name Servers have been set for both sites. I wish to move our primary sit...

I want to make date of exactly the same day in the next year. Here is my code:
$expire_time = time() + ($request->guarantee_long * 86400 * 30);
09:14
thanks
$request->guarantee_long is a number (12), which means 12 months
But my code is 360 days while a year is 365 days
any idea how can I calculate one year?
$ php --version
PHP 7.3.0-dev ...

$ composer update
...
  Problem 1
    - This package requires php-64bit ~7.2.3 but your PHP version (7.0.25) does not satisfy that requirement.
Wtf is composer doing
Are you forcing a php version in your composer file?
I do have that older version on a different path (because Ubuntu is a fucking shitstack)
Only thing in the composer.json is require php-64bit ~7.2.3
09:29
@Shafizadeh Have a look at DateTime and DateInterval php.net/manual/en/book.datetime.php
Just don't understand why it wouldn't use the php selected by path preference
try using --ignore-platform-reqs flag
is the path preference top of the list?
That will work around it, sure
Yes it is, because I can run php on it's own and get the version I've built from source (I have ~/php-src/sapi/cli at the head of the path)
than that`s as far as my knowledge goes :)
09:33
composer clearly doing something whack, probably launching a process in it's own environment and not inheriting my path variable
huh, telling circleci to use 7.1.5 and it has tried to run tests on 5.x..
maybe you are trying to run it within its own separate environment?
that does not point to global ?
@Leigh Composer definitely respects the path.
@kelunik I have my build dir added to PATH in ~/.zshrc, I can php --version and get 7.3-dev, composer is trying to use the ubuntu default that is further down the path
So it must be launching a processes in a way that doesn't get the env of the parent shell
what if you do php composer update? might be a silly thought
09:37
Even ~/php-src/sapi/cli/php ./composer.phar update tells me about the ubuntu version, invoking it with the built 7.3
@thank you @jjok and @kelunik
unrelated but, how do you expect a warning in phpunit? or should I just convert all to exceptions
@Leigh I have PATH="$PATH:$HOME/.phpenv/bin" in my .profile, which is included by .zshrc, but maybe also when the desktop manager is started.
Yea I'm guessing it's launching a sh or bash and getting a new env without my PATH
09:42
PHP_BINARY=/path/to/php composer update does it
but doesn't explain why it's gone full retard otherwise
Do you have xdebug enabled?
Not in the master build nope (probably can't enable it either, it's always behind)
Can you recommend a book/ online source for a good php learning experience, please?
~/php-src/sapi/cli/php -r 'var_dump(PHP_BINDIR);'
string(14) "/usr/local/bin"
There's the problem
Feb 9 at 9:47, by Patrick
Patrick Louys
CreateSpace Independent Publishing Platform

In this book you will learn how to... write clean and maintainable object-oriented code start a new project from scratch implement a layered architecture protect your application from XSS, CSRF and other attacks The book is structured as a tutorial and will guide you through the steps of building a modern web application from scratch. It will provide you with solid software development knowledge that you can then use as a foundation to learn more advanced approaches like domain-driven design. It's a 212-page book and consists of a theory and a tutorial part. Everything in the book is framework-agnostic and you can apply what you learn to your favorite framework. You will learn how to write clean code that stands the test of time. At the end of the book, you will know how to implement a layered architecture from scratch and how you can protect your application from the most common attack vectors. This is the book that I wanted to read when I first learned about clean code.
09:56
bindir constant is set to where it wants to be installed, not where it is
@Sean
thanks
If you know how to use PHP that is
Otherwise there's plenty of getting started resources online
as you mentioned - plenty online. Trying to pick a decent one
10:09
Hi , i have changed site url for results.php?search=key to results/key
Used Htaccess : RewriteRule ^results/(.*)$ results.php?search=$1

How to get the query string in the results.php page after url rewrite ?? pls help
i tried adding [QSA] flag but didnt worked
@NikiC I'm wondering whether it potentially is a bad idea to request large chunks of memory from the Zend allocator in favor of direct allocation via mmap or VirtualAlloc for purposes which may be long lived? I see a high probability in long lived scripts that we're getting back dirtied pages (which are then part of the rss). These large chunks are going to be largely unused (e.g. 1 MB alloc when though 4 KB will be only be used, e.g. for stacks of fibers) and physical memory be on-demand.
shall be allocated on-demand
The last thing I want to have is loads of unused memory which ends up unreleased to the system
10:28
hmpf. why is there no curl_getopt?
Why should there be?
because I need to get the opts
Will curl_getinfo help?
no, that's after the request. I need it before curl_execute is called
Well then you will have to wrap curl in your own class and get the opts with that or sth.
10:35
I need it in C. And it needs to work transparently :)
Time for an RFC I believe.
@mega6382 I need it to work from 5.3 onwards :)
Then an extension perhaps.
@jjok yeah, thanks
I spotted a test that throws different warnings (for different error codes) and not sure still how to properly test that
10:40
@Gordon I see time travel in your.....futu^H^H^H^H past.
@Ekin Test triggers warnings, or the code it's testing does?
socket_connect does
the latter
ie. Host lookup failed [-10000] or [-10002] (-10000 seems to be an unknown error)
its just testing invalid connection
@Ekin Ah. Then you should @expectedException PHPUnit\Framework\Error\Warning
Which is probably what you're doing by now.
@Gordon Time for some monkey-patching I guess.
yup
10:58
@kelunik I guess so. actually, that's what I do already. It would just be much less code if there was a getopt
Yes, but I guess you have to intercept setopt and store these options somewhere.
yes, that's what I do right now
on a completely unrelated side note: is an API that just exposes all of PHP's native functions via SOAP or REST a completely nuts idea?
it would allow you to write an entire app through an http client without requiring php to be installed. that's brilliant, right?
@Gordon It's basically a massive RCE that requires authentication (if you planned to implement that)
posted on March 07, 2018

New Cyanide and Happiness Comic

11:10
@Gordon You can just eval the request body as well.
@kelunik nah, I want people to invoke http://php.api/strpos/foo/o/1
or rather via POST or SOAP
for the lulz
@Gordon http://php.api/eval/..., done.
where is the fun in that?
You still don't need PHP installed locally ;-)
but it's too coarse grained
and eval is insecure
the api should take the input of the user, fire up a container and run the asked for function in the container and then return the result as json or something
then all we need is a fancy name and contribute it to lalavel as a next level programming paradigm
6
11:16
How about PHPzero?
PHP over HTTP
PHP0HTTP
HTTPHP
0
@Gordon Are you trying to do this 'server less' (that isn't actually server less) stuff
Because that's how you get serverless (that isn't actually serverless)
PHTTP
@Gordon oh wait, someone has done this as one of those AWS serverless pods that has a version of PHP in it.
@Gordon Will this allow me to write all my code as XML?
11:27
Sounds like a bad idea, but I still want it to happen.
HTPHP
Obviously no one likes XML, so version 2 should support Yaml and Json.
https://php.api/password_verify/...
Seems legit
@Gordon I've created a facade so you can just use Php::eval($app);
11:36
@jjok it should be a trait
@tereško Great idea!
@Gordon okay, let's use include with allow_url_include=1
@kelunik We will move to RFC and integrate fibers into 7.3, but no async/await sugar yet. That's going to happen in PHP 8 along with a native event loop (Dmitry is considering libuv) and ideally a stream layer refactor (finally) in order to internally use non-blocking I/O and have our currently blocking I/O calls yield the fiber.
11:52
@bwoebi You are? Why no async / await now?
@bwoebi Sounds awesome, cant wait for 8!
^++
I guess that's year(s)? away
@Ekin 2-3 years, yes
mkay, still great news
Man that is a long wait for it. Is that just the expected timeline for major versions now?
11:55
@Sean nothing general, but it will be at least one year after 7.3, more like 1.5-2 years
sP_
sP_
Anyone there? Urgent php help. Newbie here. Related to simple form submission.
@bwoebi Why PHP 8?
@sP_ What's the crack?
^2 /me also wonders why not earlier
@kelunik Because Dmitry said so. 7.3 is too early to get everything ready and PHP 8 will be the version after 7.3.
11:57
Will it? If it's 5 years, then there will be 7.4 at least.
sP_
sP_
@Sean ideone.com/c7258b this is my code. If possible can you try opening this in your system? So here when I put something in name it appears in console after clicking submit button twice. There's reference error and syntax error which I'm not able to fix. But somehow the form value passes after two clicks.
2 mins ago, by bwoebi
@Sean nothing general, but it will be at least one year after 7.3, more like 1.5-2 years
@bwoebi I fully agree that the stream rewrite will be pretty complex and not ready for 7.3, but the event loop could be done in time. The extensions are already there.
Anyway, I don't care about that too much, but why no async / await?
@kelunik it could. A single package where everything is well integrated would be superior.
@bwoebi LOL, that's what I said the whole time regarding fibers and the event loop, but you didn't agree with me.
12:00
@kelunik nah. Fibers are base technology you need for userland to enable it at all.
everything else is already possible in userland
1 min ago, by kelunik
Anyway, I don't care about that too much, but why no async / await?
@kelunik same reason, we don't want to fixate on Promises and deep fiber integration until we move forward with the event loop
Fiber is just an ext in core then
@bwoebi There's no deep integration. Promises are completely separate.
It's just moving from one API to another.
btw, can someone please do an informative post about fibers? that'd be appreciated
The only point with a difference is your Fiber::caller()->resume() bootstrapping.
12:03
@Ekin essentially a stackful generator
@Ekin for diet or programming?
:P
:P
@bwoebi what do you know about hybrid vm ?
@tereško Yes.
sP_
sP_
@Sean hey sean, are you checking it out?
12:05
... I guess "clothing" also would be an option, but I am completely clueless regarding those (it might be cause by genetics)
@JoeWatkins What's your concrete issue?
sP_
sP_
Hi php experts, can someone help me with this?
ideone.com/c7258b this is my code. If possible can you try opening this in your system? So here when I put something in name it appears in console after clicking submit button twice. There's reference error and syntax error which I'm not able to fix. But somehow the form value passes after two clicks.
The first time you hit submit, something = ""
The second time you hit submit (immediately after) something will be set to the input you set from the first submission
I don't have a concrete idea of what's happening yet
@bwoebi it doesn't seem to interact with phpdbg very well
sP_
sP_
@Sean Yeah, I don't want that to happen. Unable to debug it. Do you understand why it's happening?
12:08
@JoeWatkins uh, phpdbg is using its own executor?
sP_
sP_
As in why does it start with something ="" ?
@sP_ Why are you unable to debug it?
@bwoebi uh, you mean you get a stack per fiber?
@Ekin yes
sP_
sP_
@jjok I'm new to php. Started like few hours ago. Unable to figure out where I'm going wrong. It looks correct to me. But it's apparently not.
12:09
@sP_ yes, that's how you wrote it
It happens in this order:
First page load
PHP tries to access $_POST['name'] which triggers an undefined index notice because you haven't submitted the form yet
something is set to "" (because nothing has been submitted)
You submit the form.
On submit triggers, console logs out an empty string.
Second page load
Because the form was submitted, the page load now sees $_POST['name'], so no error.
something = whatever you submitted in the form.
You submit the form.
On submit handler triggers, your console spits out the original submitted value from the first submission
@bwoebi I know, I'm not sure what is going on, but php and phpdbg seems to execute differently so that uopz hooks are invoked by php but not phpdbg ...
@sP_ the javascript is being generated, before HTML is sent from the server
Wes
Wes
morn
besides, why the fuck are you using JS for this
12:12
@JoeWatkins the hybrid VM is essentially just inlined handlers inside execute_ex (navigated around with goto) for better instr cache efficiency and less pushing and popping of registers (all those ZEND_VM_HOT_HANDLERs)
@sP_ just write <?php var_dump($_POST); ?> at the top, to see, what form submitted
oh, so you can pause/resume at any point with fibers
!!rfc fiber
No votes found.
sP_
sP_
@tereško I just started learning and this is a small part of what I'm trying to achieve. So I'm not sure what all are my options yet. I'll try your dump option.
@Ekin yep and not only at the base generator
12:13
can be nested
that is cool
sP_
sP_
@Sean Thanks. If I understand correctly it's basically printing past values in console, right?
And if I use that value to do something, will my current value be used?
@bwoebi Not entirely sure yet, but I might vote against an RFC without async being a keyword. I really don't want to wrap these things in either async([$obj, 'method']) or a full anon function.
Yep. It's always one page load behind because PHP doesn't see what you've entered until you actually submit the form (and send it to the server where PHP can use it)
!!version
Ah cool, the !!issue thing is probably sorted then :p
12:16
@JoeWatkins where exactly is the entry point for uopz hook execution? uopz_return_handler?
sP_
sP_
@Sean So that's how php works, right? Is there a way to know what is in the php variable on that state?
@Sean No, don't think so. It is only the commit by @DaveRandom to see what the HTTP response code is.
@sP_ php works on the server, javascript works on the client
you are so old world php… it works in the cloud. you dont need it on the server… PHTTP FTW!
@Gordon ok, he's all yours
sP_
sP_
12:18
@tereško Oh I see.
anyone know if there is ever a technical reason to use array_merge() in preference to += for code that is guaranteed to be arrays? e.g. is there any difference between:
$data = [];

$foo1 = ['foo1' => 'bar'];
$foo2 = ['foo2' => 'bar'];

$data += $foo1; // $data = array_merge($data, $foo1);
$data += $foo2; // $data = array_merge($data, $foo2);
astonish us with your teaching skills. @Gordon, or shut your fucking trap
the two?
@tereško time to step away from the computer again.
I like PHTTP as a name… it's the sound the bytes make when going over the wire… pffffttp, pfffffhtp
Or just a horrible, horrible, fart
12:19
@Danack I didn't even know you could do $array + $array until a few weeks ago.
@Sean 'sup?
So I've always just used array_merge()
@tereško eat something. you seem hangry.
@Gordon Hey, I came up with that wooh!!
I am starving, but there is a bug on a staging environment and I cant leave, because the frontend guys need it working ASAP
12:20
@mega6382 yeah, I like it.
@tereško I can tell.
@Danack Array merge prefers the second array on key conflicts, while += prefers the first one.
@tereško cant you order some pizza in your country?
that will take an hour
or ask your colleagues to bring you something
by then I will have bitten someones head off
12:21
@kelunik thanks. So if there shouldn't be any conflicts there's not much difference?
@Danack if your arrays contain integer keys. array_merge is additive, += replaces skips identical keys
@Danack Well, except for when there are, yes.
@bwoebi Replaces? You mean skips?
@tereško so why are you teaching someone in here then instead of fixing that bug that prevents you from eating?
@kelunik yeah
because the bug is in the YAML files
12:23
delegate to @Jimbo
Integer keys are a real pain in PHP's arrays.
@bwoebi it's set as opcode handler, which php executes and phpdbg doesn't
I am of the opinion that YAML is a bug on it's own, but @Jimbo thinks different
5
phpdbg never enters ZEND_USER_OPCODE_SPEC_HANDLER
@JoeWatkins I'm guessing lxr.room11.org/xref/php-src%40master/Zend/… is overwriting your handler?
12:25
@mega6382 yeh I didn't get as far as figuring out what the actual problem is. It's returning 404, but I'm guessing there's a more descriptive error message in the response body, just haven't had a change to log it out and inspect it yet. /cc @Sean
Yo, thanks @MadaraUchiha for the wisdom the other night by the way. Trying to split out those levels is uh, well I can't seem to figure out a good way for it without it feeling strange. Like, my main gripe is what's the point in a generic converter to change data from domdoc to something (assoc array? stdclass?) when you still need to know the data structure to traverse it.
@Sean Remind me, please? 😃
But having a convert method which pulls back specific data from the domdocument isn't generic either.
2 days ago, by Madara Uchiha
@Sean I like to think in layers and concepts, and not with implementations
:-P
@JoeWatkins it needs to re-fetch the handler as the OPLINE->handler points to a goto label within execute_ex ...
sP_
sP_
@tereško Thank you so much. It is so much easier to understand now.
12:37
@Gordon It's so much easier to work with and update than any other format I've seen so far.
It's faster for a human to parse and reason about, and change
@Jimbo you clearly didnt work with XML then
Hello everyone, I am facing problem in Laravel 5.4, my code is working properly on local host but on aws ubuntu server only root file is open. Another controller are not found and 404 error genrate when we call another controller or say my rotue file is not working. please suggest me any solution it's urgent
sP_
sP_
@Sean
@Jimbo but I agree it's fast to parse and change. you just see it and immediately knowit's crap and then you just change it to xml
sP_
sP_
I have one more question.
12:45
@JitendraMalviya It sounds like your web server isn't configured correctly to handle URL rewrites.
@jjok how can i configure it
@Gordon So, btw, are you serious about making this API?
@sP_ Hmm?
@JitendraMalviya The same way you configured it during development.
@mega6382 you wanna help? feel free to start. I'll join in when I find the time.
12:49
@Gordon Sure, sounds wonderful. A few pointers to start with would be helpful.
sP_
sP_
@Sean So what I'm trying to achieve is, take form values and use them for an api. Api returns a JSON obj. Now using data from this json I've to build a table. And I've been asked not to build html table using php echo statements. I've to use js for that.

How do you think I should go about this? I'm getting stuck because I've to mix php and js for this.
@mega6382 it's a pointless project, so there are no pointers to give
@sP_ building a table in Javascript, from the data returned is just a case of sitting down and writing some Javascript.
@mega6382 Will include 'http://3v4l.org/' work?
12:53
Just look at using document.createElement(....); and it should be obvious.
@jjok Yeah, that might just be all the code we need
@bwoebi yeah zend_vm_get_opcode_handler_func ignored user opcodes
sP_
sP_
@Danack yes but my problem is this. How do I use form value and use it in php. Once I figure that out, I'll call api in php and get the json obj. How do I use this obj in js?
they're not overwritten by anything, they are there, just not used by zend_vm_get_opcode_handler_func
@JoeWatkins yeah, that's what I meant … not sure about what to do with that, possibly contact dmitry
12:56
@sP_ you probably don't. Using the form value in Javascript, and then calling a PHP api from Javscript sounds like a better plan.
sP_
sP_
I also considered this, but if I do that I'll have to use js variables in php, right? How do I do it?

PS sorry I've just started learning this like one day ago. So I'm not sure about all the ways to do things.

« first day (2699 days earlier)      last day (2475 days later) »