Broj π se može obračunati na više načina (Arhimed, Bazelski problem i slično), a čini se da je jedna zakonotost povoljna da se to uradi programski.
Continue reading “Kako do broja PI? Korak 1”Tag: php
PHP APCU on Debian
apt install gcc make autoconf libc-dev pkg-config php-dev
pecl channel-update pecl.php.net
pecl install apcu
You should add “extension=apcu.so” to php.ini
/etc/php/8.2/fpm/conf.d/20-apcu.ini
or try:
echo "extension=apcu.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"`
PHP vs Python pack format comparation
Differences between PHP and Python pack/unpack format characters
Continue reading “PHP vs Python pack format comparation”What’s new in PHP 8
After a lot of to-ing and fro-ing as to when PHP 8 would be released, the developers have now announced that November 26th, 2020 is the date we’re waiting for.
The new version of PHP is expected to come with some new features that offer web developers many additional possibilities.
JIT Compiler, JSON extension always activated, Union Types, Static return type, WeakMap, Use ::class for objects, Stringable interface, Convert DateTime, Type annotations, Type errors…
Continue reading “What’s new in PHP 8”PHP list() and Shorthand for Array Destructuring
PHP construct list() or its shorthand can be useful in many cases. It can be very useful to use it with PHP functions that returns arrays. Supun Kavinda have interesting article about.
Continue reading “PHP list() and Shorthand for Array Destructuring”php5.6, php7 on ubuntu14 via phpbrew
Installation procedure for php5.6 (officel release) and php7 (alpha) on Ubuntu 14.04, via
phpbrew package. Continue reading “php5.6, php7 on ubuntu14 via phpbrew”
Install PHP 5.4 as standalone
PHP 5.4 is not packaged on most Linux distributions so it may be easiest to install it from source. On Debian-based Linux systems, you can use the following commands to install PHP 5.4 in such a way that it won’t effect any other versions of PHP that you may have installed: Continue reading “Install PHP 5.4 as standalone”
PHP sada ima ugrađeni veb server
Dočekali smo i PHP verziju 5.4.0.
New features in PHP
- Improvements in memory management and performance.
- Traits – A new mechanism for code reuse. It reduces the limitations of single inheritance.
- Shortened Array syntax. Now use
[...]
instead ofarray(...)
to create arrays. - Magic Quotes have been deprecated and entirely removed in PHP 5.4.0. Other language features that have been given the boot are safe mode,
break
/continue
, and$var
syntax. - WordPress, Drupal, and every other PHP based websites will run faster when they start using PHP 5.4.0.
- Built-in Web server – PHP 5.4.0 now bundles its own web server which can be used for testing purpose. So you don’t need to install Apache web server to learn PHP/develop a website any more.
- New version of Zend Framework.
PostgreSQL function call model for PHP
This article describes a simple class that can be used to call PostgreSQL functions. Using the class has a number of advantages:
- PostgreSQL functions can be called like they are PHP method functions with no special syntax.
- The statements are automatically prepared giving faster execution for multiple calls.
- No string escaping is needed for prepared statements.
- The prepared statements are automatically deallocated when the object is destructed.
NOTE: PostgreSQL prepared statement support requries PHP 5.1 or later. Continue reading “PostgreSQL function call model for PHP”