subreddit
stringclasses
7 values
author
stringlengths
3
20
id
stringlengths
5
7
content
stringlengths
67
30.4k
score
int64
0
140k
lolphp
barubary
hk1ojtv
<|soss|><|sot|>Get class: Just a lol<|eot|><|sost|>Consider this example: class A { } class Foo { public static function bar($x) { echo get_class($x), "\n"; } } Foo::bar(new A()); Foo::bar(null); Its just broken.<|eost|><|sor|>> Its just broken. Broken how? What happens when you run that code? What did you expect to happen instead?<|eor|><|eoss|><|endoftext|>
5
lolphp
Takeoded
ishbfn
<|sols|><|sot|>ArrayAccess seems broken<|eot|><|sol|>https://3v4l.org/Woc0R<|eol|><|eols|><|endoftext|>
0
lolphp
funtek
g57rkgb
<|sols|><|sot|>ArrayAccess seems broken<|eot|><|sol|>https://3v4l.org/Woc0R<|eol|><|sor|>ArrayAccess is for... array access. Accesing using []. That does not mean you can use it anywhere where array is expected. It's unexpected, yes, but perfectly logical and the error is clearly explaining what is going on.<|eor|><|eols|><|endoftext|>
22
lolphp
przemo_li
g57rsg7
<|sols|><|sot|>ArrayAccess seems broken<|eot|><|sol|>https://3v4l.org/Woc0R<|eol|><|sor|>So we do lol because language supported something in version X, deprecated it in X + 1, and abandoned it in X + 2? ??? &#x200B; Here is offical doc for ArrayAccess: > Interface to provide accessing objects as arrays. That would suggest only syntax of using `[name_of_index]` is scope of this ArrayAccess thing. Hence X + 2 works actually as expected.<|eor|><|eols|><|endoftext|>
9
lolphp
jesseschalken
g58e7tj
<|sols|><|sot|>ArrayAccess seems broken<|eot|><|sol|>https://3v4l.org/Woc0R<|eol|><|sor|>ArrayAccess is for... array access. Accesing using []. That does not mean you can use it anywhere where array is expected. It's unexpected, yes, but perfectly logical and the error is clearly explaining what is going on.<|eor|><|sor|>Yeah, the second parameter of `array_key_exists` is of type `array`. It's pretty obvious. In C++ if I overload `operator[]`, that doesn't mean I can pass my object to something demanding an `std::vector`...<|eor|><|eols|><|endoftext|>
8
lolphp
przemo_li
g57sb0i
<|sols|><|sot|>ArrayAccess seems broken<|eot|><|sol|>https://3v4l.org/Woc0R<|eol|><|sor|>So we do lol because language supported something in version X, deprecated it in X + 1, and abandoned it in X + 2? ??? &#x200B; Here is offical doc for ArrayAccess: > Interface to provide accessing objects as arrays. That would suggest only syntax of using `[name_of_index]` is scope of this ArrayAccess thing. Hence X + 2 works actually as expected.<|eor|><|soopr|>> So we do lol because language supported something in version X, deprecated it in X + 1, and abandoned it in X + 2? no, my point is that ArrayAccess did not let array_key_exist() access the object as an array, it should have, it has "ArrayAccess", remember?<|eoopr|><|sor|>How do you know that `array_key_exists` works by doing `$secondArgument[$firstArgument]` ? So I do stand by my comment. Deprecation of something that is not part of official specification.<|eor|><|eols|><|endoftext|>
6
lolphp
youstolemyname
g57u4m6
<|sols|><|sot|>ArrayAccess seems broken<|eot|><|sol|>https://3v4l.org/Woc0R<|eol|><|sor|>https://3v4l.org/CUTpa<|eor|><|eols|><|endoftext|>
5
lolphp
feketegy
cljm3p
<|sols|><|sot|>$GLOBALS contains GLOBALS because GLOBALS is a global...<|eot|><|sol|>https://www.reddit.com/r/PHP/comments/clj570/what_is_the_logic_behind_that_globals_has_a/<|eol|><|eols|><|endoftext|>
0
lolphp
mort96
evvqlpf
<|sols|><|sot|>$GLOBALS contains GLOBALS because GLOBALS is a global...<|eot|><|sol|>https://www.reddit.com/r/PHP/comments/clj570/what_is_the_logic_behind_that_globals_has_a/<|eol|><|sor|>I don't see how this is lolphp? If you're going to have a global variable which represents all the global variables, it better contain a reference to itself. It's not like objects having references to themselves is that crazy.<|eor|><|eols|><|endoftext|>
40
lolphp
smog_alado
evvs58m
<|sols|><|sot|>$GLOBALS contains GLOBALS because GLOBALS is a global...<|eot|><|sol|>https://www.reddit.com/r/PHP/comments/clj570/what_is_the_logic_behind_that_globals_has_a/<|eol|><|sor|>I don't see how this is lolphp? If you're going to have a global variable which represents all the global variables, it better contain a reference to itself. It's not like objects having references to themselves is that crazy.<|eor|><|sor|>A similar thing happens in Javascript with `window.window` and in Lua, with `_G._G`<|eor|><|eols|><|endoftext|>
24
lolphp
Almamu
evx3gd2
<|sols|><|sot|>$GLOBALS contains GLOBALS because GLOBALS is a global...<|eot|><|sol|>https://www.reddit.com/r/PHP/comments/clj570/what_is_the_logic_behind_that_globals_has_a/<|eol|><|sor|>I don't see how this is lolphp? If you're going to have a global variable which represents all the global variables, it better contain a reference to itself. It's not like objects having references to themselves is that crazy.<|eor|><|sor|>In the post he also mentions that $GLOBALS is missing _REQUEST for $_REQUEST<|eor|><|sor|>Because that global is automatically populated only when used, there's a ini setting to control that behavior.<|eor|><|eols|><|endoftext|>
6
lolphp
Adybo123
evwreat
<|sols|><|sot|>$GLOBALS contains GLOBALS because GLOBALS is a global...<|eot|><|sol|>https://www.reddit.com/r/PHP/comments/clj570/what_is_the_logic_behind_that_globals_has_a/<|eol|><|sor|>I don't see how this is lolphp? If you're going to have a global variable which represents all the global variables, it better contain a reference to itself. It's not like objects having references to themselves is that crazy.<|eor|><|sor|>In the post he also mentions that $GLOBALS is missing _REQUEST for $_REQUEST<|eor|><|eols|><|endoftext|>
5
lolphp
Garegin16
o36cno
<|soss|><|sot|>Why was PHP invented in the first place?<|eot|><|sost|>The standard story is that he needed a visitor counter. Why not just do it with Perl or Python? Why invent another language? Im not saying that PHP is bad. But what value did it provide other than that it became popular so its easy to deploy. Thats like saying English is ubiquitous. But that doesnt make it simpler than Spanish. People keep saying that its so easy to learn. But to me, the simplest language is probably Java. I would even go out and say that the really bad parts are mostly in the library or the environment. Not the actual language. They all are sister languages anyway. For all we care, browsers could run on Ruby instead of JS and it wouldnt make a difference<|eost|><|eoss|><|endoftext|>
0
lolphp
IdealBlueMan
h2a9yq4
<|soss|><|sot|>Why was PHP invented in the first place?<|eot|><|sost|>The standard story is that he needed a visitor counter. Why not just do it with Perl or Python? Why invent another language? Im not saying that PHP is bad. But what value did it provide other than that it became popular so its easy to deploy. Thats like saying English is ubiquitous. But that doesnt make it simpler than Spanish. People keep saying that its so easy to learn. But to me, the simplest language is probably Java. I would even go out and say that the really bad parts are mostly in the library or the environment. Not the actual language. They all are sister languages anyway. For all we care, browsers could run on Ruby instead of JS and it wouldnt make a difference<|eost|><|sor|>The Wikipedia page kinda says. He built chunks of CGI functionality in C and created a scripting language to tie them together. Python wasnt nearly universal at the time. The main advantage of PHP over perl was that you could throw snippets of code into your HTML file and the server would interpret them as the page was served. Perl, at the time anyway, didnt do that.<|eor|><|eoss|><|endoftext|>
45
lolphp
Max-P
h2artzd
<|soss|><|sot|>Why was PHP invented in the first place?<|eot|><|sost|>The standard story is that he needed a visitor counter. Why not just do it with Perl or Python? Why invent another language? Im not saying that PHP is bad. But what value did it provide other than that it became popular so its easy to deploy. Thats like saying English is ubiquitous. But that doesnt make it simpler than Spanish. People keep saying that its so easy to learn. But to me, the simplest language is probably Java. I would even go out and say that the really bad parts are mostly in the library or the environment. Not the actual language. They all are sister languages anyway. For all we care, browsers could run on Ruby instead of JS and it wouldnt make a difference<|eost|><|sor|>PHP was designed to be incredibly simple to deploy, at least originally. Most sites were still fairly static with the rate cgi-bin scripts there and there. Most of these were ran with Apache httpd. How to start using PHP in your site back then? Rename your `.html` to `.php`, start adding PHP code to it. Done. That's it. Even with Perl, it's an order of magnitude harder already: you have to make a script that will read an HTML source, substitute some stuff with computed values and return it to the browser. It's not hard per-se, but still compared to naming your file `.php` and adding `<?= $whatever ?>` to your code, that's more work. Another nice feature of PHP, back then at least, was that supporting it was basically free: it runs in httpd. Your PHP script would take precious server resources only the brief moment it's running when the page is being generated. When your server had 8MB of RAM, that was a pretty big deal. Nowadays we just run Docker containers containing a whole OS and web server and interpreter, but back then running an extra daemon just for one page would be insane and expensive. This blew up immensely in shared hosting, especially free ones, and made dynamic sites accessible to a much larger chunk of people, which ultimately resulted in it being used everywhere, especially smaller/cheaper sites. I very distinctly remember when I was a 13 year old kid that the *only* hosting I was able to find was either static only, or PHP if they were nice, and not *too* locked down if they were very nice. And this remained as such for a very long time until the late 2000s.<|eor|><|eoss|><|endoftext|>
36
lolphp
cq73
h2bb35s
<|soss|><|sot|>Why was PHP invented in the first place?<|eot|><|sost|>The standard story is that he needed a visitor counter. Why not just do it with Perl or Python? Why invent another language? Im not saying that PHP is bad. But what value did it provide other than that it became popular so its easy to deploy. Thats like saying English is ubiquitous. But that doesnt make it simpler than Spanish. People keep saying that its so easy to learn. But to me, the simplest language is probably Java. I would even go out and say that the really bad parts are mostly in the library or the environment. Not the actual language. They all are sister languages anyway. For all we care, browsers could run on Ruby instead of JS and it wouldnt make a difference<|eost|><|sor|>> The standard story is that he needed a visitor counter. Why not just do it with Perl or Python? Running websites with Python wasn't really a thing then. The common way was to run Perl behind CGI. >Im not saying that PHP is bad. But what value did it provide other than that it became popular so its easy to deploy. That's already a ton of value. >They all are sister languages anyway. For all we care, browsers could run on Ruby instead of JS and it wouldnt make a difference Why ever do anything new at all, amirite??<|eor|><|soopr|>My point was that he could have made a preexisting language work on a web server instead of inventing one from scratch. Also most languages have some defining value. What was PHPs? Why not just embed an already existing language into HTML. And yes, most languages are a NIH. Powershell is basically another C like language. They could have just as easily made a Python REPL.<|eoopr|><|sor|>I think the context you are missing is the state of the industry at the time. You keep wondering why people didnt just use technologies that wouldnt exist until many years after PHP had become popular and entrenched.<|eor|><|eoss|><|endoftext|>
12
lolphp
chucker23n
h2bba8o
<|soss|><|sot|>Why was PHP invented in the first place?<|eot|><|sost|>The standard story is that he needed a visitor counter. Why not just do it with Perl or Python? Why invent another language? Im not saying that PHP is bad. But what value did it provide other than that it became popular so its easy to deploy. Thats like saying English is ubiquitous. But that doesnt make it simpler than Spanish. People keep saying that its so easy to learn. But to me, the simplest language is probably Java. I would even go out and say that the really bad parts are mostly in the library or the environment. Not the actual language. They all are sister languages anyway. For all we care, browsers could run on Ruby instead of JS and it wouldnt make a difference<|eost|><|sor|>> The standard story is that he needed a visitor counter. Why not just do it with Perl or Python? Running websites with Python wasn't really a thing then. The common way was to run Perl behind CGI. >Im not saying that PHP is bad. But what value did it provide other than that it became popular so its easy to deploy. That's already a ton of value. >They all are sister languages anyway. For all we care, browsers could run on Ruby instead of JS and it wouldnt make a difference Why ever do anything new at all, amirite??<|eor|><|soopr|>My point was that he could have made a preexisting language work on a web server instead of inventing one from scratch. Also most languages have some defining value. What was PHPs? Why not just embed an already existing language into HTML. And yes, most languages are a NIH. Powershell is basically another C like language. They could have just as easily made a Python REPL.<|eoopr|><|sor|>> My point was that he could have made a preexisting language work on a web server instead of inventing one from scratch. Yes (though Perl wouldve been the only viable choice), but why? > Powershell is basically another C like language. They could have just as easily made a Python REPL. lol, ok Why bother creating things, man? So much exists already! is not the deep take you think it is.<|eor|><|soopr|>And most of these NIH languages are basically toys that languish in obscurity.<|eoopr|><|sor|>And PHP wasnt, so whats your point?<|eor|><|eoss|><|endoftext|>
12
lolphp
chucker23n
h2b5mnw
<|soss|><|sot|>Why was PHP invented in the first place?<|eot|><|sost|>The standard story is that he needed a visitor counter. Why not just do it with Perl or Python? Why invent another language? Im not saying that PHP is bad. But what value did it provide other than that it became popular so its easy to deploy. Thats like saying English is ubiquitous. But that doesnt make it simpler than Spanish. People keep saying that its so easy to learn. But to me, the simplest language is probably Java. I would even go out and say that the really bad parts are mostly in the library or the environment. Not the actual language. They all are sister languages anyway. For all we care, browsers could run on Ruby instead of JS and it wouldnt make a difference<|eost|><|sor|>> The standard story is that he needed a visitor counter. Why not just do it with Perl or Python? Running websites with Python wasn't really a thing then. The common way was to run Perl behind CGI. >Im not saying that PHP is bad. But what value did it provide other than that it became popular so its easy to deploy. That's already a ton of value. >They all are sister languages anyway. For all we care, browsers could run on Ruby instead of JS and it wouldnt make a difference Why ever do anything new at all, amirite??<|eor|><|eoss|><|endoftext|>
11
lolphp
Orgalorgg
h2b070h
<|soss|><|sot|>Why was PHP invented in the first place?<|eot|><|sost|>The standard story is that he needed a visitor counter. Why not just do it with Perl or Python? Why invent another language? Im not saying that PHP is bad. But what value did it provide other than that it became popular so its easy to deploy. Thats like saying English is ubiquitous. But that doesnt make it simpler than Spanish. People keep saying that its so easy to learn. But to me, the simplest language is probably Java. I would even go out and say that the really bad parts are mostly in the library or the environment. Not the actual language. They all are sister languages anyway. For all we care, browsers could run on Ruby instead of JS and it wouldnt make a difference<|eost|><|sor|>Just a small addition to these comments, PHP and Java were both created the same year (1995) - this was before the plethora of server-side rendering languages existed. Microsoft's Active Server Pages wouldn't exist for another 5 years, and that's still early on in the web's history.<|eor|><|eoss|><|endoftext|>
11
lolphp
chucker23n
h2b8g02
<|soss|><|sot|>Why was PHP invented in the first place?<|eot|><|sost|>The standard story is that he needed a visitor counter. Why not just do it with Perl or Python? Why invent another language? Im not saying that PHP is bad. But what value did it provide other than that it became popular so its easy to deploy. Thats like saying English is ubiquitous. But that doesnt make it simpler than Spanish. People keep saying that its so easy to learn. But to me, the simplest language is probably Java. I would even go out and say that the really bad parts are mostly in the library or the environment. Not the actual language. They all are sister languages anyway. For all we care, browsers could run on Ruby instead of JS and it wouldnt make a difference<|eost|><|sor|>> The standard story is that he needed a visitor counter. Why not just do it with Perl or Python? Running websites with Python wasn't really a thing then. The common way was to run Perl behind CGI. >Im not saying that PHP is bad. But what value did it provide other than that it became popular so its easy to deploy. That's already a ton of value. >They all are sister languages anyway. For all we care, browsers could run on Ruby instead of JS and it wouldnt make a difference Why ever do anything new at all, amirite??<|eor|><|soopr|>My point was that he could have made a preexisting language work on a web server instead of inventing one from scratch. Also most languages have some defining value. What was PHPs? Why not just embed an already existing language into HTML. And yes, most languages are a NIH. Powershell is basically another C like language. They could have just as easily made a Python REPL.<|eoopr|><|sor|>> My point was that he could have made a preexisting language work on a web server instead of inventing one from scratch. Yes (though Perl wouldve been the only viable choice), but why? > Powershell is basically another C like language. They could have just as easily made a Python REPL. lol, ok Why bother creating things, man? So much exists already! is not the deep take you think it is.<|eor|><|eoss|><|endoftext|>
11
lolphp
cfreak2399
h2bzdo5
<|soss|><|sot|>Why was PHP invented in the first place?<|eot|><|sost|>The standard story is that he needed a visitor counter. Why not just do it with Perl or Python? Why invent another language? Im not saying that PHP is bad. But what value did it provide other than that it became popular so its easy to deploy. Thats like saying English is ubiquitous. But that doesnt make it simpler than Spanish. People keep saying that its so easy to learn. But to me, the simplest language is probably Java. I would even go out and say that the really bad parts are mostly in the library or the environment. Not the actual language. They all are sister languages anyway. For all we care, browsers could run on Ruby instead of JS and it wouldnt make a difference<|eost|><|sor|>I think PHP also caught on because of a curious problem between mod_perl, the Apache module that allowed for speedier Perl implementations, and Apache's ability to do Named Virtual Hosting. Prior to 1997ish? (I couldn't find an exact reference for when it came out) - you needed a separate IP for each website you wanted to host. mod_perl was developed around this time as well and worked by putting the Perl interpreter inside shared memory of Apache, making it much faster than traditional CGI scripts. This has two trade-offs though. Memory in Apache 1 was shared between all the children, meaning a global variable inside Perl was actually visible in other children and other requests. Coding was a lot harder than just throwing up quick and dirty Perl scripts. The global nature of Perl was ok for people developing serious sites on a single site on a single server. But Named Virtual Hosting led to an explosion in hosting companies. Now everyone could have a website but they quickly found mod_perl is unworkable in that environment. PHP, on the other hand, was a bit faster than traditional CGI and much easier to develop with. The Perl 6 debacle didn't help either.<|eor|><|eoss|><|endoftext|>
10
lolphp
cq73
h2bbii8
<|soss|><|sot|>Why was PHP invented in the first place?<|eot|><|sost|>The standard story is that he needed a visitor counter. Why not just do it with Perl or Python? Why invent another language? Im not saying that PHP is bad. But what value did it provide other than that it became popular so its easy to deploy. Thats like saying English is ubiquitous. But that doesnt make it simpler than Spanish. People keep saying that its so easy to learn. But to me, the simplest language is probably Java. I would even go out and say that the really bad parts are mostly in the library or the environment. Not the actual language. They all are sister languages anyway. For all we care, browsers could run on Ruby instead of JS and it wouldnt make a difference<|eost|><|sor|>> The standard story is that he needed a visitor counter. Why not just do it with Perl or Python? Running websites with Python wasn't really a thing then. The common way was to run Perl behind CGI. >Im not saying that PHP is bad. But what value did it provide other than that it became popular so its easy to deploy. That's already a ton of value. >They all are sister languages anyway. For all we care, browsers could run on Ruby instead of JS and it wouldnt make a difference Why ever do anything new at all, amirite??<|eor|><|soopr|>My point was that he could have made a preexisting language work on a web server instead of inventing one from scratch. Also most languages have some defining value. What was PHPs? Why not just embed an already existing language into HTML. And yes, most languages are a NIH. Powershell is basically another C like language. They could have just as easily made a Python REPL.<|eoopr|><|sor|>I think the context you are missing is the state of the industry at the time. You keep wondering why people didnt just use technologies that wouldnt exist until many years after PHP had become popular and entrenched.<|eor|><|soopr|>Ok. But he invented a whole **new** language. He could have just adopted Python for the web. Look, if he wanted to scratch his invention itch; thats fine. But writing a whole new language for a visitor counter?<|eoopr|><|sor|>Python wasnt really a thing at all back then. Thats what you are missing.<|eor|><|eoss|><|endoftext|>
10
lolphp
captain_obvious_here
h2chye2
<|soss|><|sot|>Why was PHP invented in the first place?<|eot|><|sost|>The standard story is that he needed a visitor counter. Why not just do it with Perl or Python? Why invent another language? Im not saying that PHP is bad. But what value did it provide other than that it became popular so its easy to deploy. Thats like saying English is ubiquitous. But that doesnt make it simpler than Spanish. People keep saying that its so easy to learn. But to me, the simplest language is probably Java. I would even go out and say that the really bad parts are mostly in the library or the environment. Not the actual language. They all are sister languages anyway. For all we care, browsers could run on Ruby instead of JS and it wouldnt make a difference<|eost|><|sor|>The Wikipedia page kinda says. He built chunks of CGI functionality in C and created a scripting language to tie them together. Python wasnt nearly universal at the time. The main advantage of PHP over perl was that you could throw snippets of code into your HTML file and the server would interpret them as the page was served. Perl, at the time anyway, didnt do that.<|eor|><|sor|>> Perl, at the time anyway, didnt do that. Mod_perl (for Apache) did. But I think people never liked it.<|eor|><|eoss|><|endoftext|>
7
lolphp
IdealBlueMan
h2cwfb3
<|soss|><|sot|>Why was PHP invented in the first place?<|eot|><|sost|>The standard story is that he needed a visitor counter. Why not just do it with Perl or Python? Why invent another language? Im not saying that PHP is bad. But what value did it provide other than that it became popular so its easy to deploy. Thats like saying English is ubiquitous. But that doesnt make it simpler than Spanish. People keep saying that its so easy to learn. But to me, the simplest language is probably Java. I would even go out and say that the really bad parts are mostly in the library or the environment. Not the actual language. They all are sister languages anyway. For all we care, browsers could run on Ruby instead of JS and it wouldnt make a difference<|eost|><|sor|>The Wikipedia page kinda says. He built chunks of CGI functionality in C and created a scripting language to tie them together. Python wasnt nearly universal at the time. The main advantage of PHP over perl was that you could throw snippets of code into your HTML file and the server would interpret them as the page was served. Perl, at the time anyway, didnt do that.<|eor|><|sor|>> Perl, at the time anyway, didnt do that. Mod_perl (for Apache) did. But I think people never liked it.<|eor|><|sor|>Did mod-perl let you embed chunks of perl in HTML files? From what I remember, it ran perl scripts without shelling out to the system.<|eor|><|eoss|><|endoftext|>
7
lolphp
cq73
h2j95kv
<|soss|><|sot|>Why was PHP invented in the first place?<|eot|><|sost|>The standard story is that he needed a visitor counter. Why not just do it with Perl or Python? Why invent another language? Im not saying that PHP is bad. But what value did it provide other than that it became popular so its easy to deploy. Thats like saying English is ubiquitous. But that doesnt make it simpler than Spanish. People keep saying that its so easy to learn. But to me, the simplest language is probably Java. I would even go out and say that the really bad parts are mostly in the library or the environment. Not the actual language. They all are sister languages anyway. For all we care, browsers could run on Ruby instead of JS and it wouldnt make a difference<|eost|><|sor|>> The standard story is that he needed a visitor counter. Why not just do it with Perl or Python? Running websites with Python wasn't really a thing then. The common way was to run Perl behind CGI. >Im not saying that PHP is bad. But what value did it provide other than that it became popular so its easy to deploy. That's already a ton of value. >They all are sister languages anyway. For all we care, browsers could run on Ruby instead of JS and it wouldnt make a difference Why ever do anything new at all, amirite??<|eor|><|soopr|>My point was that he could have made a preexisting language work on a web server instead of inventing one from scratch. Also most languages have some defining value. What was PHPs? Why not just embed an already existing language into HTML. And yes, most languages are a NIH. Powershell is basically another C like language. They could have just as easily made a Python REPL.<|eoopr|><|sor|>>Also most languages have some defining value. What was PHPs? Accessibility, really. I can't find the post, but there was a really good post of a guy that had been working in C and other old-school languages when PHP came along. His mind was *blown* when he saw you could put the contents of a URL into a string using a *single call*. In other languages at the time like C, you had to mess around with sockets and handles and make sure you handled them all correctly or get memory leaks, and so on. PHP abstracted over all of this complexity and allowed people to get down to business writing valuable high-impact code and not have to mess with "pesky" language details like memory management and types and resources, etc.<|eor|><|soopr|>So, basically the creator improved on what he knew. He knew Perl, so he worked from there. He wasnt interested in adopting pre-existing languages like Python.<|eoopr|><|sor|>I think youre failing to realize - while Python was around at that point, very few people knew it or even knew about it.<|eor|><|soopr|>Fair enough.<|eoopr|><|sor|>> Fair enough. This is the 4th or 5th time in this thread that someone has pointed out this exact fact to you. When will it sink in?<|eor|><|eoss|><|endoftext|>
7
lolphp
picklemanjaro
h2cm85q
<|soss|><|sot|>Why was PHP invented in the first place?<|eot|><|sost|>The standard story is that he needed a visitor counter. Why not just do it with Perl or Python? Why invent another language? Im not saying that PHP is bad. But what value did it provide other than that it became popular so its easy to deploy. Thats like saying English is ubiquitous. But that doesnt make it simpler than Spanish. People keep saying that its so easy to learn. But to me, the simplest language is probably Java. I would even go out and say that the really bad parts are mostly in the library or the environment. Not the actual language. They all are sister languages anyway. For all we care, browsers could run on Ruby instead of JS and it wouldnt make a difference<|eost|><|sor|>The Wikipedia page kinda says. He built chunks of CGI functionality in C and created a scripting language to tie them together. Python wasnt nearly universal at the time. The main advantage of PHP over perl was that you could throw snippets of code into your HTML file and the server would interpret them as the page was served. Perl, at the time anyway, didnt do that.<|eor|><|sor|>> Perl, at the time anyway, didnt do that. Mod_perl (for Apache) did. But I think people never liked it.<|eor|><|sor|>Didn't mod_perl come out about a year after PHP? (95 vs 96 from what I could tell)<|eor|><|eoss|><|endoftext|>
6
lolphp
squiggleslash
h2bjh6r
<|soss|><|sot|>Why was PHP invented in the first place?<|eot|><|sost|>The standard story is that he needed a visitor counter. Why not just do it with Perl or Python? Why invent another language? Im not saying that PHP is bad. But what value did it provide other than that it became popular so its easy to deploy. Thats like saying English is ubiquitous. But that doesnt make it simpler than Spanish. People keep saying that its so easy to learn. But to me, the simplest language is probably Java. I would even go out and say that the really bad parts are mostly in the library or the environment. Not the actual language. They all are sister languages anyway. For all we care, browsers could run on Ruby instead of JS and it wouldnt make a difference<|eost|><|sor|>> The standard story is that he needed a visitor counter. Why not just do it with Perl or Python? Running websites with Python wasn't really a thing then. The common way was to run Perl behind CGI. >Im not saying that PHP is bad. But what value did it provide other than that it became popular so its easy to deploy. That's already a ton of value. >They all are sister languages anyway. For all we care, browsers could run on Ruby instead of JS and it wouldnt make a difference Why ever do anything new at all, amirite??<|eor|><|soopr|>My point was that he could have made a preexisting language work on a web server instead of inventing one from scratch. Also most languages have some defining value. What was PHPs? Why not just embed an already existing language into HTML. And yes, most languages are a NIH. Powershell is basically another C like language. They could have just as easily made a Python REPL.<|eoopr|><|sor|>You're assuming he knew Python, et al. By all accounts the only language he knew was C, and PHP was an attempt to create a dumbed down C that could be embedded in web pages, so in a sense he did roughly what you're asking for, it's just between the growth of the programming language where it's gone way beyond its initial roots, and the rise of more obvious choices than C, it's less easy to see what he was trying to do. Back when PHP was being developed, before 1995, scripting languages weren't the big thing they are today. C, C++, and to a lesser extent BASIC, ruled the personal computer development world (BASIC largely for legacy reasons, though VB kept it relevant at a professional level.) Anyone who went to university in the previous ten years probably knew at least two of those three plus a Niklaus Wirth language like PASCAL or MODULA 2, and perhaps a more academic esoteric language like LISP or PROLOG. The only one of those that's vaguely scripting like - and I really mean vaguely - is BASIC. Don't get me wrong, Perl and Python existed, they just didn't have the mindshare they would have by the end of the decade. Scripting in the Unix world was usually done with bourne shell scripts. So, in its weird way, PHP starting out as being a templating language using a crude subset of C makes sense given the time and context.<|eor|><|eoss|><|endoftext|>
6
lolphp
SaltineAmerican_1970
h2bvp4c
<|soss|><|sot|>Why was PHP invented in the first place?<|eot|><|sost|>The standard story is that he needed a visitor counter. Why not just do it with Perl or Python? Why invent another language? Im not saying that PHP is bad. But what value did it provide other than that it became popular so its easy to deploy. Thats like saying English is ubiquitous. But that doesnt make it simpler than Spanish. People keep saying that its so easy to learn. But to me, the simplest language is probably Java. I would even go out and say that the really bad parts are mostly in the library or the environment. Not the actual language. They all are sister languages anyway. For all we care, browsers could run on Ruby instead of JS and it wouldnt make a difference<|eost|><|sor|>> The standard story is that he needed a visitor counter. Why not just do it with Perl or Python? Running websites with Python wasn't really a thing then. The common way was to run Perl behind CGI. >Im not saying that PHP is bad. But what value did it provide other than that it became popular so its easy to deploy. That's already a ton of value. >They all are sister languages anyway. For all we care, browsers could run on Ruby instead of JS and it wouldnt make a difference Why ever do anything new at all, amirite??<|eor|><|soopr|>My point was that he could have made a preexisting language work on a web server instead of inventing one from scratch. Also most languages have some defining value. What was PHPs? Why not just embed an already existing language into HTML. And yes, most languages are a NIH. Powershell is basically another C like language. They could have just as easily made a Python REPL.<|eoopr|><|sor|>>My point was that he could have made a preexisting language work on a web server instead of inventing one from scratch. Sir Edmund Hillary could have chosen to walk up Aoraki / Mount Cook, but where is the challenge in that?<|eor|><|soopr|>Well sure. Lets just say he had an itch a scratch. Inventing a whole language for a visitor counter is silly.<|eoopr|><|sor|>First you say "I need a counter." Then you keep designing and say "I need a..." and make it. Then you need a... Then you share your script library with a friend who needs a... and a... And someone else needs a... But it grows and becomes more complex to add all these little scripts, so you create a wrapper and other people contribute, and the language grows. It's not like he said "I think I'll design this entire scripting language just for a single counter."<|eor|><|eoss|><|endoftext|>
6
lolphp
hexmode
h52llq6
<|soss|><|sot|>Why was PHP invented in the first place?<|eot|><|sost|>The standard story is that he needed a visitor counter. Why not just do it with Perl or Python? Why invent another language? Im not saying that PHP is bad. But what value did it provide other than that it became popular so its easy to deploy. Thats like saying English is ubiquitous. But that doesnt make it simpler than Spanish. People keep saying that its so easy to learn. But to me, the simplest language is probably Java. I would even go out and say that the really bad parts are mostly in the library or the environment. Not the actual language. They all are sister languages anyway. For all we care, browsers could run on Ruby instead of JS and it wouldnt make a difference<|eost|><|sor|>PHP was designed to be incredibly simple to deploy, at least originally. Most sites were still fairly static with the rate cgi-bin scripts there and there. Most of these were ran with Apache httpd. How to start using PHP in your site back then? Rename your `.html` to `.php`, start adding PHP code to it. Done. That's it. Even with Perl, it's an order of magnitude harder already: you have to make a script that will read an HTML source, substitute some stuff with computed values and return it to the browser. It's not hard per-se, but still compared to naming your file `.php` and adding `<?= $whatever ?>` to your code, that's more work. Another nice feature of PHP, back then at least, was that supporting it was basically free: it runs in httpd. Your PHP script would take precious server resources only the brief moment it's running when the page is being generated. When your server had 8MB of RAM, that was a pretty big deal. Nowadays we just run Docker containers containing a whole OS and web server and interpreter, but back then running an extra daemon just for one page would be insane and expensive. This blew up immensely in shared hosting, especially free ones, and made dynamic sites accessible to a much larger chunk of people, which ultimately resulted in it being used everywhere, especially smaller/cheaper sites. I very distinctly remember when I was a 13 year old kid that the *only* hosting I was able to find was either static only, or PHP if they were nice, and not *too* locked down if they were very nice. And this remained as such for a very long time until the late 2000s.<|eor|><|sor|>> Your PHP script would take precious server resources only the brief moment it's running when the page is being generated. [...] back then running an extra daemon just for one page would be insane and expensive. That's not unique to PHP; that's the CGI execution model.<|eor|><|sor|>cgi requires a [fork](https://www.oreilly.com/openbook/cgi/ch10_10.html). php runs in the server process itself, no forking needed. the act of forking gets expensive when you do a lot of it.<|eor|><|eoss|><|endoftext|>
5
lolphp
savageronald
h2dz4sg
<|soss|><|sot|>Why was PHP invented in the first place?<|eot|><|sost|>The standard story is that he needed a visitor counter. Why not just do it with Perl or Python? Why invent another language? Im not saying that PHP is bad. But what value did it provide other than that it became popular so its easy to deploy. Thats like saying English is ubiquitous. But that doesnt make it simpler than Spanish. People keep saying that its so easy to learn. But to me, the simplest language is probably Java. I would even go out and say that the really bad parts are mostly in the library or the environment. Not the actual language. They all are sister languages anyway. For all we care, browsers could run on Ruby instead of JS and it wouldnt make a difference<|eost|><|sor|>> The standard story is that he needed a visitor counter. Why not just do it with Perl or Python? Running websites with Python wasn't really a thing then. The common way was to run Perl behind CGI. >Im not saying that PHP is bad. But what value did it provide other than that it became popular so its easy to deploy. That's already a ton of value. >They all are sister languages anyway. For all we care, browsers could run on Ruby instead of JS and it wouldnt make a difference Why ever do anything new at all, amirite??<|eor|><|soopr|>My point was that he could have made a preexisting language work on a web server instead of inventing one from scratch. Also most languages have some defining value. What was PHPs? Why not just embed an already existing language into HTML. And yes, most languages are a NIH. Powershell is basically another C like language. They could have just as easily made a Python REPL.<|eoopr|><|sor|>>Also most languages have some defining value. What was PHPs? Accessibility, really. I can't find the post, but there was a really good post of a guy that had been working in C and other old-school languages when PHP came along. His mind was *blown* when he saw you could put the contents of a URL into a string using a *single call*. In other languages at the time like C, you had to mess around with sockets and handles and make sure you handled them all correctly or get memory leaks, and so on. PHP abstracted over all of this complexity and allowed people to get down to business writing valuable high-impact code and not have to mess with "pesky" language details like memory management and types and resources, etc.<|eor|><|soopr|>So, basically the creator improved on what he knew. He knew Perl, so he worked from there. He wasnt interested in adopting pre-existing languages like Python.<|eoopr|><|sor|>I think youre failing to realize - while Python was around at that point, very few people knew it or even knew about it.<|eor|><|eoss|><|endoftext|>
5