4 ms·
> "You don't need a library or a framework to talk HTTP." With 'library' typically meaning 'extension' in PHP parlance, you do. The socket methods are part of
by FuzzyDunlop 15y ago
> "You don't need a library or a framework to talk HTTP."
With 'library' typically meaning 'extension' in PHP parlance, you do. The socket methods are part of the Socket extension, cURL is an extension you have to compile in.
The only reason you'd not actually notice this is because, unless you compiled your own copy of PHP, it will have been done in the default install bundled with the OS, or in xAMP, and will have automatically been injected into the 'global' scope.
This is all just daft, though. You could go on forever with the "it can't do X but it can do Y" schtick, with any language.
- wvenable 15y agoI think what he meant wasn't about sockets or Curl, but the fact that PHP is integrated with the HTTP request itself. You don't need an extension for PHP to output HTML or read in query parameters. Python developers user REPL to quickly test elements of their code or play around with the language; PHP developers hit refresh.
- Jach 15y agoThere are two other interpretations of the statement. One is that you don't need any import/includes, which is true of PHP but not of Python. The second is you don't need any external dependencies "out of the box", ignoring the fact that someone had to make the box[1] for you at some point which you mention here. This is true of PHP, and only half-true of Python: I remember messing with "import cgi" at some point, Flask is so so much better. [1] Gentoo's USE flags for PHP (the ones with - are the ones I haven't compiled in for my box): apache2 bcmath berkdb bzip2 cgi cjk cli crypt ctype curl curlwrappers fileinfo filter ftp gd gdbm hash iconv ipv6 json mysql mysqli nls pdo phar posix postgres readline session simplexml sockets spell sqlite sqlite3 ssl threads tokenizer truetype unicode xml xmlreader xpm zip zlib -calendar -cdb -debug -doc -embed -enchant -exif -firebird -flatfile -fpm -frontbase -gmp -imap -inifile -intl -iodbc -kerberos -kolab -ldap -ldap-sasl -libedit -mhash -mssql -mysqlnd -oci8-instant-client -odbc -pcntl -pic -qdbm -recode -sharedmem -snmp -soap -suhosin -sybase-ct -sysvipc -tidy -wddx -xmlrpc -xmlwriter -xsl