Re: [PHP] ZendCodeAnalyzer oddity

2012-10-31 Thread tamouse mailing lists
On Wed, Oct 31, 2012 at 3:42 PM, Christoph Boget wrote: > Consider the following code: > > class bob > { > static function factory() > { > echo 'In factory!'; > } > } > > bob::factory(); > $var = 'bob'; > $var::factory(); > ?> > > When I run this, "In Factory!" is displayed twice,

Re: [PHP] TURBOPY cloud framework + IDE beta available NOW

2012-10-31 Thread Adam Richardson
On Wed, Oct 31, 2012 at 4:46 PM, Marco Behnke wrote: > > 1. If you have code using static methods and members and use phpunit for > testing it, you have to either make sure, that everything is properly > resetted after use OR have to run phpunit in a mode where every test is run > in a single php

Re: [PHP] Re: Multithreading for OOP PHP

2012-10-31 Thread Alex Nikitin
You do all that in the context of a single PHP instance and linear code, calling curl_multi handles its own threading, you just get back results, you dont have to store it anywhere outside PHP memory space, and you can configure timeouts and all that stuff, or you can regulate it yourself. The data

Re: [PHP] Multithreading for OOP PHP

2012-10-31 Thread Dotan Cohen
> It's just as we sometimes use PHP for doing some big Server works (e.g. > database copying or something) and > it would be nice to controll by yourself which Thread (or process) does which > part of the job. > I don't suppose that the client is sitting there waiting for a reply until the brows

Re: [PHP] TURBOPY cloud framework + IDE beta available NOW

2012-10-31 Thread Marco Behnke
Am 31.10.12 18:13, schrieb Adam Richardson: > While OOP is one way to approach programming, it's not the only way. Even > Rasmus has said he leans procedurally: > http://toys.lerdorf.com/archives/38-The-no-framework-PHP-MVC-framework.html Found another interesting discussion on that topic: http://

Re: [PHP] TURBOPY cloud framework + IDE beta available NOW

2012-10-31 Thread Marco Behnke
Am 31.10.12 18:13, schrieb Adam Richardson: > On Tue, Oct 30, 2012 at 7:33 AM, ma...@behnke.biz wrote: > >> In times of testability and several design patters, the use of static >> calls is >> really outdated. >> I understand that you can read and write the invocations of the methods >> much >> fa

[PHP] ZendCodeAnalyzer oddity

2012-10-31 Thread Christoph Boget
Consider the following code: '; } } bob::factory(); $var = 'bob'; $var::factory(); ?> When I run this, "In Factory!" is displayed twice, as I would expect. So by all accounts, there's nothing wrong with the code. However, when I run that file through ZendCodeAnalyzer, I get the followin

Re: [PHP] Re: Multithreading for OOP PHP

2012-10-31 Thread Tommy Pham
On Wed, Oct 31, 2012 at 9:27 AM, Alex Nikitin wrote: >> >> That's all understood but there are times when that one request from >> the visitor requires many sub-requests like connection to DB and >> making SOAP calls. > > > I would say it's more than just "there are times", that's how a typical >

Re: [PHP] Multithreading for OOP PHP

2012-10-31 Thread Matijn Woudt
On Wed, Oct 31, 2012 at 11:37 AM, Florian Müller wrote: > I actually tought about just the same structures as Java uses(something in > this way: > Thread t = new Thread(new Runnable() {public void run() { > ...blabla }} > I thought this would actually be a good benefit if PHP suppor

Re: [PHP] Multithreading for OOP PHP

2012-10-31 Thread Larry Garfield
On 10/31/12 1:58 AM, Florian Müller wrote: Hi guys I was wondering, what actually the reason is that PHP itself does not support multi-threading? I guess this would be realizable, or not? If not, why? Maybe this is a stupid question, but still somehow interesting. Realization in a way as Java d

Re: Re: [PHP] TURBOPY cloud framework + IDE beta available NOW

2012-10-31 Thread Adam Richardson
On Tue, Oct 30, 2012 at 7:33 AM, ma...@behnke.biz wrote: > > In times of testability and several design patters, the use of static > calls is > really outdated. > I understand that you can read and write the invocations of the methods > much > faster, but you should think more to the future on th

Re: [PHP] Re: Multithreading for OOP PHP

2012-10-31 Thread Alex Nikitin
> > > That's all understood but there are times when that one request from > the visitor requires many sub-requests like connection to DB and > making SOAP calls. I would say it's more than just "there are times", that's how a typical script lives, it imports libraries, queries the database, and

Re: [PHP] Re: Multithreading for OOP PHP

2012-10-31 Thread Tommy Pham
On Wed, Oct 31, 2012 at 6:46 AM, Alex Nikitin wrote: > Hey guys (and/or gals), > > I have heard this question entirely too many times, I think at some point > Rasmus just stopped responding to it. The real reason that PHP is not > threaded has nothing to do with PHP internal or extension thread sa

Re: [PHP] Re: Multithreading for OOP PHP

2012-10-31 Thread Alex Nikitin
Hey guys (and/or gals), I have heard this question entirely too many times, I think at some point Rasmus just stopped responding to it. The real reason that PHP is not threaded has nothing to do with PHP internal or extension thread safety, the reason is more to the extent that it doesn't make sen

[PHP] Re: Multithreading for OOP PHP

2012-10-31 Thread Alessandro Pellizzari
Il Wed, 31 Oct 2012 11:50:00 +0100, ma...@behnke.biz ha scritto: > The drawback of forking is the memory overhead. With every fork you take > the same amount of memory which is not the case if you could use real > threads. No, it is not. Forking in Linux uses COW (copy-on-write), so a freshly-for

[PHP] Re: Multithreading for OOP PHP

2012-10-31 Thread Alessandro Pellizzari
Il Wed, 31 Oct 2012 11:57:11 +0100, ma...@behnke.biz ha scritto: > But it if PHP would be threadsafe, you would be able to run the Apache > in a much faster and less memory using way. > There once was a configure option in PHP to compile it threadsafe, but > they dropped it for a reason. Because

Re: [PHP] Multithreading for OOP PHP

2012-10-31 Thread ma...@behnke.biz
Ovidiu Farauanu hat am 31. Oktober 2012 um 09:59 geschrieben: > Yes Marco has right. > > But more than that, OOP is mainly designed to run in a single threaded . I don't put a comment on that. > environment and it is not the best idea to be used for concurrent > programming because you wil

Re: [PHP] Multithreading for OOP PHP

2012-10-31 Thread ma...@behnke.biz
Ovidiu Farauanu hat am 31. Oktober 2012 um 09:59 geschrieben: > Hello Florian, > > Usually you want to run a PHP script in two different environments: > 1. inside a webserver > 2. in a command line interface > > For a web application, the application server does the work for you. > It is the ser

RE: [PHP] Multithreading for OOP PHP

2012-10-31 Thread Florian Müller
I actually tought about just the same structures as Java uses(something in this way: Thread t = new Thread(new Runnable() {public void run() {...blabla }} I thought this would actually be a good benefit if PHP supported this. It's just as we sometimes use PHP for doing some big Ser

[PHP] Multithreading for OOP PHP

2012-10-31 Thread Ovidiu Farauanu
Yes Marco has right. But more than that, OOP is mainly designed to run in a single threaded environment and it is not the best idea to be used for concurrent programming because you will need synchronization everywhere and this slows down the code, but also ask for a lot of other troubles. I thin

[PHP] Multithreading for OOP PHP

2012-10-31 Thread Ovidiu Farauanu
Hello Florian, Usually you want to run a PHP script in two different environments: 1. inside a webserver 2. in a command line interface For a web application, the application server does the work for you. It is the server job to have a thread pool and balance it correctly. So you don't need threa

Re: [PHP] Multithreading for OOP PHP

2012-10-31 Thread ma...@behnke.biz
"Florian Müller" hat am 31. Oktober 2012 um 07:58 geschrieben: > Hi guys > I was wondering, what actually the reason is that PHP itself does not support > multi-threading? > I guess this would be realizable, or not? If not, why? > Maybe this is a stupid question, but still somehow interesting. Rea

Re: [PHP] TURBOPY cloud framework + IDE beta available NOW

2012-10-31 Thread ma...@behnke.biz
Johannes Reichardt hat am 30. Oktober 2012 um 16:37 geschrieben: > > In times of testability and several design patters, the use of static calls > > is > > really outdated. > > I understand that you can read and write the invocations of the methods much > > faster, but you should think more to t

[PHP] Multithreading for OOP PHP

2012-10-31 Thread Florian Müller
Hi guys I was wondering, what actually the reason is that PHP itself does not support multi-threading? I guess this would be realizable, or not? If not, why? Maybe this is a stupid question, but still somehow interesting. Realization in a way as Java does (or just something in that way) would act